[Cmake-commits] CMake branch, next, updated. v2.8.3-925-g4bf0929

Brad King brad.king at kitware.com
Wed Dec 15 16:52:10 EST 2010


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, next has been updated
       via  4bf09291e4e2893dbb0d9ba5d0d9ace5428b3fb7 (commit)
       via  f48d3bc5ba69906ee3c61ddb103a91bf6467c86d (commit)
      from  4e64be31da0684ba3036bc510b0fd1f76c84f32c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=4bf09291e4e2893dbb0d9ba5d0d9ace5428b3fb7
commit 4bf09291e4e2893dbb0d9ba5d0d9ace5428b3fb7
Merge: 4e64be3 f48d3bc
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Dec 15 16:52:08 2010 -0500
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Wed Dec 15 16:52:08 2010 -0500

    Merge topic 'ctest-depend-cycle' into next
    
    f48d3bc CTest: Fix test DEPEND cycle detection


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f48d3bc5ba69906ee3c61ddb103a91bf6467c86d
commit f48d3bc5ba69906ee3c61ddb103a91bf6467c86d
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Dec 15 16:49:34 2010 -0500
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Wed Dec 15 16:49:34 2010 -0500

    CTest: Fix test DEPEND cycle detection
    
    A cycle exists when the DFS returns to the root node, not just when
    multiple paths lead to the same node.
    
    Inspired-By: Alexander Esilevich <aesilevich at pathscale.com>

diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index 93c2963..ca26c98 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -653,32 +653,37 @@ bool cmCTestMultiProcessHandler::CheckCycles()
       it != this->Tests.end(); ++it)
     {
     //DFS from each element to itself
+    int root = it->first;
+    std::set<int> visited;
     std::stack<int> s;
-    std::vector<int> visited;
-
-    s.push(it->first);
-
+    s.push(root);
     while(!s.empty())
       {
       int test = s.top();
       s.pop();
-
-      for(TestSet::iterator d = this->Tests[test].begin();
-          d != this->Tests[test].end(); ++d)
+      if(visited.insert(test).second)
         {
-        if(std::find(visited.begin(), visited.end(), *d) != visited.end())
+        for(TestSet::iterator d = this->Tests[test].begin();
+            d != this->Tests[test].end(); ++d)
           {
-          //cycle exists
-          cmCTestLog(this->CTest, ERROR_MESSAGE, "Error: a cycle exists in "
-            "the test dependency graph for the test \""
-            << this->Properties[it->first]->Name << "\"." << std::endl
-            << "Please fix the cycle and run ctest again." << std::endl);
-          return false;
+          if(*d == root)
+            {
+            //cycle exists
+            cmCTestLog(this->CTest, ERROR_MESSAGE, "Error: a cycle exists in "
+                       "the test dependency graph for the test \""
+                       << this->Properties[root]->Name << "\"." << std::endl
+                       << "Please fix the cycle and run ctest again." << std::endl);
+            return false;
+            }
+          else
+            {
+            s.push(*d);
+            }
           }
-        s.push(*d);
         }
-      visited.push_back(test);
       }
     }
+  cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT,
+             "Checking test dependency graph end" << std::endl);
   return true;
 }
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 04f0774..e43fc75 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -779,6 +779,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
     --test-command ${CMAKE_CTEST_COMMAND} -C \${CTEST_CONFIGURATION_TYPE}
     )
+  SET_TESTS_PROPERTIES(testing PROPERTIES PASS_REGULAR_EXPRESSION "Passed")
   LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Testing")
 
   ADD_TEST(wrapping  ${CMAKE_CTEST_COMMAND}
diff --git a/Tests/Testing/Sub/Sub2/CMakeLists.txt b/Tests/Testing/Sub/Sub2/CMakeLists.txt
index 3a7295d..fb9e861 100644
--- a/Tests/Testing/Sub/Sub2/CMakeLists.txt
+++ b/Tests/Testing/Sub/Sub2/CMakeLists.txt
@@ -3,3 +3,15 @@
 #
 ADD_EXECUTABLE(testing2 testing2.cxx)
 ADD_TEST(testing.2 ${Testing_BINARY_DIR}/bin/testing2)
+
+add_test(NotCycle.a ${CMAKE_COMMAND} -E echo a)
+add_test(NotCycle.test1 ${CMAKE_COMMAND} -E echo test1)
+set_property(TEST NotCycle.test1 PROPERTY DEPENDS NotCycle.a)
+
+add_test(NotCycle.b ${CMAKE_COMMAND} -E echo b)
+add_test(NotCycle.test2 ${CMAKE_COMMAND} -E echo test2)
+set_property(TEST NotCycle.test2 PROPERTY DEPENDS NotCycle.b NotCycle.test1)
+
+add_test(NotCycle.c ${CMAKE_COMMAND} -E echo c)
+add_test(NotCycle.test3 ${CMAKE_COMMAND} -E echo test3)
+set_property(TEST NotCycle.test3 PROPERTY DEPENDS NotCycle.c NotCycle.test1 NotCycle.test2)

-----------------------------------------------------------------------

Summary of changes:
 Source/CTest/cmCTestMultiProcessHandler.cxx |   37 +++++++++++++++-----------
 Tests/CMakeLists.txt                        |    1 +
 Tests/Testing/Sub/Sub2/CMakeLists.txt       |   12 ++++++++
 3 files changed, 34 insertions(+), 16 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list