[Cmake-commits] CMake branch, next, updated. v2.8.3-1156-g27920f2

Zach Mullen zach.mullen at kitware.com
Mon Jan 3 14:42:57 EST 2011


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  27920f2ff7f657fb01e0b9c7164e95c1e982b643 (commit)
       via  51bb49357495ea2742858ffe9d76ab3f44efc06e (commit)
      from  e207994883b65b3ddcfdbfec9c0068f59252d796 (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=27920f2ff7f657fb01e0b9c7164e95c1e982b643
commit 27920f2ff7f657fb01e0b9c7164e95c1e982b643
Merge: e207994 51bb493
Author:     Zach Mullen <zach.mullen at kitware.com>
AuthorDate: Mon Jan 3 14:42:30 2011 -0500
Commit:     Zach Mullen <zach.mullen at kitware.com>
CommitDate: Mon Jan 3 14:42:30 2011 -0500

    Merge branch 'honor-explicit-zero-timeout' into next


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=51bb49357495ea2742858ffe9d76ab3f44efc06e
commit 51bb49357495ea2742858ffe9d76ab3f44efc06e
Author:     Zach Mullen <zach.mullen at kitware.com>
AuthorDate: Mon Jan 3 14:41:25 2011 -0500
Commit:     Zach Mullen <zach.mullen at kitware.com>
CommitDate: Mon Jan 3 14:41:25 2011 -0500

    Test TIMEOUT property explicitly set to zero should be honored

diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx
index 76ff23a..42a4cff 100644
--- a/Source/CTest/cmCTestRunTest.cxx
+++ b/Source/CTest/cmCTestRunTest.cxx
@@ -455,7 +455,8 @@ bool cmCTestRunTest::StartTest(size_t total)
     {
     return false;
     }
-  return this->ForkProcess(timeout, &this->TestProperties->Environment);
+  return this->ForkProcess(timeout, this->TestProperties->ExplicitTimeout,
+                           &this->TestProperties->Environment);
 }
 
 //----------------------------------------------------------------------
@@ -598,7 +599,7 @@ double cmCTestRunTest::ResolveTimeout()
 }
 
 //----------------------------------------------------------------------
-bool cmCTestRunTest::ForkProcess(double testTimeOut,
+bool cmCTestRunTest::ForkProcess(double testTimeOut, bool explicitTimeout,
                      std::vector<std::string>* environment)
 {
   this->TestProcess = new cmProcess;
@@ -619,12 +620,16 @@ bool cmCTestRunTest::ForkProcess(double testTimeOut,
     {
     timeout = testTimeOut;
     }
-
   // always have at least 1 second if we got to here
   if (timeout <= 0)
     {
     timeout = 1;
     }
+  // handle timeout explicitly set to 0
+  if (testTimeOut == 0 && explicitTimeout)
+    {
+    timeout = 0;
+    }
   cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, this->Index << ": "
              << "Test timeout computed to be: " << timeout << "\n");
 
diff --git a/Source/CTest/cmCTestRunTest.h b/Source/CTest/cmCTestRunTest.h
index 66e6b7b..89456d5 100644
--- a/Source/CTest/cmCTestRunTest.h
+++ b/Source/CTest/cmCTestRunTest.h
@@ -63,8 +63,8 @@ private:
   void ExeNotFound(std::string exe);
   // Figures out a final timeout which is min(STOP_TIME, NOW+TIMEOUT)
   double ResolveTimeout();
-  bool ForkProcess(double testTimeOut,
-                     std::vector<std::string>* environment);
+  bool ForkProcess(double testTimeOut, bool explicitTimeout,
+                   std::vector<std::string>* environment);
   void WriteLogOutputTop(size_t completed, size_t total);
   //Run post processing of the process output for MemCheck
   void MemCheckPostProcess();
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index 6d1af2d..fdafb9b 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -2122,6 +2122,7 @@ bool cmCTestTestHandler::SetTestsProperties(
           if ( key == "TIMEOUT" )
             {
             rtit->Timeout = atof(val.c_str());
+            rtit->ExplicitTimeout = true;
             }
           if ( key == "COST" )
             {
@@ -2295,6 +2296,7 @@ bool cmCTestTestHandler::AddTest(const std::vector<std::string>& args)
   test.WillFail = false;
   test.RunSerial = false;
   test.Timeout = 0;
+  test.ExplicitTimeout = false;
   test.Cost = 0;
   test.Processors = 1;
   test.PreviousRuns = 0;
diff --git a/Source/CTest/cmCTestTestHandler.h b/Source/CTest/cmCTestTestHandler.h
index 7049564..7aa8522 100644
--- a/Source/CTest/cmCTestTestHandler.h
+++ b/Source/CTest/cmCTestTestHandler.h
@@ -99,6 +99,7 @@ public:
     int PreviousRuns;
     bool RunSerial;
     double Timeout;
+    bool ExplicitTimeout;
     int Index;
     //Requested number of process slots
     int Processors;
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 289e632..466adda 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -45,18 +45,18 @@ IF(BUILD_TESTING)
   SET(TEST_BUILD_DIRS)
 
   # Should the long tests be run?
-  OPTION(CMAKE_RUN_LONG_TESTS 
+  OPTION(CMAKE_RUN_LONG_TESTS
     "Should the long tests be run (such as Bootstrap)." ON)
   MARK_AS_ADVANCED(CMAKE_RUN_LONG_TESTS)
 
   IF (CMAKE_RUN_LONG_TESTS)
-    OPTION(CTEST_TEST_CTEST 
-      "Should the tests that run a full sub ctest process be run?" 
+    OPTION(CTEST_TEST_CTEST
+      "Should the tests that run a full sub ctest process be run?"
       OFF)
     MARK_AS_ADVANCED(CTEST_TEST_CTEST)
 
     OPTION(TEST_KDE4_STABLE_BRANCH
-      "Should the KDE4 stable branch test be run?" 
+      "Should the KDE4 stable branch test be run?"
       OFF)
     MARK_AS_ADVANCED(TEST_KDE4_STABLE_BRANCH)
   ENDIF (CMAKE_RUN_LONG_TESTS)
@@ -214,7 +214,7 @@ IF(BUILD_TESTING)
 
   # If we are running right now with a UnixMakefiles based generator,
   # build the "Simple" test with the ExtraGenerators, if available
-  # This doesn't test whether the generated project files work (unfortunately), 
+  # This doesn't test whether the generated project files work (unfortunately),
   # mainly it tests that cmake doesn't crash when generating these project files.
   IF(${CMAKE_TEST_GENERATOR} MATCHES "Unix Makefiles"  OR  ${CMAKE_TEST_GENERATOR} MATCHES "KDevelop")
     # check which generators we have
@@ -286,10 +286,10 @@ IF(BUILD_TESTING)
     ADD_TEST(SubProject-Stage2  ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/SubProject/foo"
-      "${CMake_BINARY_DIR}/Tests/SubProject/foo" 
+      "${CMake_BINARY_DIR}/Tests/SubProject/foo"
       --build-generator ${CMAKE_TEST_GENERATOR}
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-      --build-nocmake 
+      --build-nocmake
       --build-project foo
       --build-target foo
       --test-command foo
@@ -347,7 +347,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-generator ${CMAKE_TEST_GENERATOR}
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
     --build-project TargetName
-    --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files 
+    --test-command ${CMAKE_CMAKE_COMMAND} -E compare_files
     ${CMake_SOURCE_DIR}/Tests/TargetName/scripts/hello_world
     ${CMake_BINARY_DIR}/Tests/TargetName/scripts/hello_world)
   LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/TargetName")
@@ -359,7 +359,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-two-config
     --build-generator ${CMAKE_TEST_GENERATOR}
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-    --build-project LibName 
+    --build-project LibName
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/LibName/lib"
     --test-command foobar
     )
@@ -372,7 +372,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-two-config
     --build-generator ${CMAKE_TEST_GENERATOR}
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-    --build-project CustComDepend 
+    --build-project CustComDepend
     --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustComDepend/bin"
     --test-command foo bar.c
     )
@@ -451,7 +451,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
     )
   LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BuildDepends")
-  
+
   SET(SimpleInstallInstallDir
     "${CMake_BINARY_DIR}/Tests/SimpleInstall/InstallDirectory")
   ADD_TEST(SimpleInstall ${CMAKE_CTEST_COMMAND}
@@ -884,7 +884,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 # RPATH isn't supported under Syllable, so the tests don't
 # find their libraries. In order to fix that LIBRARY_OUTPUT_DIR
 # in the tests would have to be adjusted to ${EXECUTABLE_OUTPUT_DIR}/lib .
-# For now we just require on Syllable that the user adjusts the DLL_PATH 
+# For now we just require on Syllable that the user adjusts the DLL_PATH
 # environment variable, so except the two tests below all other tests will succeed.
 
     SET(_DLL_PATH "$ENV{DLL_PATH}")
@@ -993,14 +993,14 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 
   # only add this test on platforms that support it
   # some old versions of make simply cannot handle spaces in paths
-  IF (MAKE_IS_GNU OR 
+  IF (MAKE_IS_GNU OR
       "${CMAKE_TEST_MAKEPROGRAM}" MATCHES "nmake|gmake|wmake" OR
       "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio|XCode|Borland")
     ADD_TEST(SubDirSpaces ${CMAKE_CTEST_COMMAND}
       --build-and-test
       "${CMake_SOURCE_DIR}/Tests/SubDirSpaces"
       "${CMake_BINARY_DIR}/Tests/SubDirSpaces"
-      --build-exe-dir 
+      --build-exe-dir
       "${CMake_BINARY_DIR}/Tests/SubDirSpaces/Executable Sources"
       --build-generator ${CMAKE_TEST_GENERATOR}
       --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
@@ -1106,7 +1106,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       "${CMake_BINARY_DIR}/Tests/BundleGeneratorTest"
       --build-two-config
       --build-generator ${CMAKE_TEST_GENERATOR}
-      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} 
+      --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
       --build-project BundleGeneratorTest
       --build-target package
       --build-options "-DCMAKE_INSTALL_PREFIX:PATH=${CMake_BINARY_DIR}/Tests/BundleGeneratorTest/InstallDirectory"
@@ -1341,7 +1341,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     SET_TESTS_PROPERTIES(CTestTestCrash PROPERTIES
       PASS_REGULAR_EXPRESSION "SegFault")
   ENDIF(CMAKE_TEST_GENERATOR MATCHES "Watcom WMake")
-    
+
   CONFIGURE_FILE(
     "${CMake_SOURCE_DIR}/Tests/CTestTestBadExe/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestBadExe/test.cmake"
@@ -1419,7 +1419,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
   #make sure all 3 subdirs were added
   SET_TESTS_PROPERTIES(CTestTestSubdir PROPERTIES
     PASS_REGULAR_EXPRESSION "0 tests failed out of 3")
-    
+
   CONFIGURE_FILE(
     "${CMake_SOURCE_DIR}/Tests/CTestTestTimeout/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestTimeout/test.cmake"
@@ -1433,6 +1433,17 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
     PASS_REGULAR_EXPRESSION "TestTimeout *\\.+ *\\*\\*\\*Timeout.*CheckChild *\\.+ *Passed")
 
   CONFIGURE_FILE(
+    "${CMake_SOURCE_DIR}/Tests/CTestTestZeroTimeout/test.cmake.in"
+    "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake"
+    @ONLY ESCAPE_QUOTES)
+  ADD_TEST(CTestTestZeroTimeout ${CMAKE_CTEST_COMMAND}
+    -S "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/test.cmake" -V
+    --output-log
+    "${CMake_BINARY_DIR}/Tests/CTestTestZeroTimeout/testOutput.log")
+  SET_TESTS_PROPERTIES(CTestTestZeroTimeout PROPERTIES
+    FAIL_REGULAR_EXPRESSION "\\*\\*\\*Timeout")
+
+  CONFIGURE_FILE(
     "${CMake_SOURCE_DIR}/Tests/CTestTestDepends/test.cmake.in"
     "${CMake_BINARY_DIR}/Tests/CTestTestDepends/test.cmake"
     @ONLY ESCAPE_QUOTES)
@@ -1614,7 +1625,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
 
     ENDIF(UNIX)
   ENDIF (CMAKE_RUN_LONG_TESTS AND TEST_KDE4_STABLE_BRANCH)
-  
+
   IF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
     SET(CMAKE_SKIP_BOOTSTRAP_TEST 1)
   ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES Xcode)
@@ -1641,7 +1652,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
       --build-noclean
       --build-makeprogram ${bootstrap}
       --build-generator "${CMAKE_TEST_GENERATOR}"
-      --test-command 
+      --test-command
       ${CMake_BINARY_DIR}/Tests/BootstrapTest/Bootstrap.cmk/cmake)
     LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/BootstrapTest")
     # Make this test run early during parallel execution
@@ -1735,8 +1746,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         "-DCMAKE_C_COMPILER=${SDCC_EXECUTABLE}")
       LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/SimpleCOnly_sdcc")
     ENDIF(SDCC_EXECUTABLE)
-    
-    
+
+
     FIND_PROGRAM(MINGW_CC_LINUX2WIN_EXECUTABLE i586-mingw32msvc-gcc)
     FIND_PROGRAM(MINGW_CXX_LINUX2WIN_EXECUTABLE i586-mingw32msvc-g++)
     MARK_AS_ADVANCED(MINGW_CC_LINUX2WIN_EXECUTABLE MINGW_CXX_LINUX2WIN_EXECUTABLE)
@@ -1754,8 +1765,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
         "-DCMAKE_CXX_COMPILER=${MINGW_CXX_LINUX2WIN_EXECUTABLE}")
       LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Simple_Mingw_Linux2Win")
     ENDIF(MINGW_CC_LINUX2WIN_EXECUTABLE  AND  MINGW_CXX_LINUX2WIN_EXECUTABLE)
-    
-    
+
+
   ENDIF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop")
 
   IF(UNIX)
diff --git a/Tests/CTestTestZeroTimeout/CMakeLists.txt b/Tests/CTestTestZeroTimeout/CMakeLists.txt
new file mode 100644
index 0000000..8a5246d
--- /dev/null
+++ b/Tests/CTestTestZeroTimeout/CMakeLists.txt
@@ -0,0 +1,8 @@
+CMAKE_MINIMUM_REQUIRED (VERSION 2.6)
+PROJECT (CTestTestZeroTimeout)
+INCLUDE (CTest)
+
+ADD_EXECUTABLE (Sleep sleep.c)
+
+ADD_TEST (TestExplicitZeroTimeout Sleep)
+SET_TESTS_PROPERTIES(TestExplicitZeroTimeout PROPERTIES TIMEOUT 0)
diff --git a/Tests/CTestTestZeroTimeout/CTestConfig.cmake b/Tests/CTestTestZeroTimeout/CTestConfig.cmake
new file mode 100644
index 0000000..f8e0609
--- /dev/null
+++ b/Tests/CTestTestZeroTimeout/CTestConfig.cmake
@@ -0,0 +1,7 @@
+set(CTEST_PROJECT_NAME "CTestTestZeroTimeout")
+set(CTEST_NIGHTLY_START_TIME "21:00:00 EDT")
+set(CTEST_DART_SERVER_VERSION "2")
+set(CTEST_DROP_METHOD "http")
+set(CTEST_DROP_SITE "www.cdash.org")
+set(CTEST_DROP_LOCATION "/CDash/submit.php?project=PublicDashboard")
+set(CTEST_DROP_SITE_CDASH TRUE)
diff --git a/Tests/CTestTestZeroTimeout/sleep.c b/Tests/CTestTestZeroTimeout/sleep.c
new file mode 100644
index 0000000..d40d59d
--- /dev/null
+++ b/Tests/CTestTestZeroTimeout/sleep.c
@@ -0,0 +1,16 @@
+#if defined(_WIN32)
+# include <windows.h>
+#else
+# include <unistd.h>
+#endif
+
+/* sleeps for 5 seconds */
+int main(int argc, char** argv)
+{
+#if defined(_WIN32)
+  Sleep(5000);
+#else
+  sleep(5);
+#endif
+  return 0;
+}
diff --git a/Tests/CTestTestZeroTimeout/test.cmake.in b/Tests/CTestTestZeroTimeout/test.cmake.in
new file mode 100644
index 0000000..0ff32a4
--- /dev/null
+++ b/Tests/CTestTestZeroTimeout/test.cmake.in
@@ -0,0 +1,23 @@
+CMAKE_MINIMUM_REQUIRED(VERSION 2.1)
+
+# Settings:
+SET(CTEST_DASHBOARD_ROOT                "@CMake_BINARY_DIR@/Tests/CTestTest")
+SET(CTEST_SITE                          "@SITE@")
+SET(CTEST_BUILD_NAME                    "CTestTest- at BUILDNAME@-ZeroTimeout")
+
+SET(CTEST_SOURCE_DIRECTORY              "@CMake_SOURCE_DIR@/Tests/CTestTestZeroTimeout")
+SET(CTEST_BINARY_DIRECTORY              "@CMake_BINARY_DIR@/Tests/CTestTestZeroTimeout")
+SET(CTEST_CVS_COMMAND                   "@CVSCOMMAND@")
+SET(CTEST_CMAKE_GENERATOR               "@CMAKE_TEST_GENERATOR@")
+SET(CTEST_BUILD_CONFIGURATION           "$ENV{CMAKE_CONFIG_TYPE}")
+SET(CTEST_MEMORYCHECK_COMMAND           "@MEMORYCHECK_COMMAND@")
+SET(CTEST_MEMORYCHECK_SUPPRESSIONS_FILE "@MEMORYCHECK_SUPPRESSIONS_FILE@")
+SET(CTEST_MEMORYCHECK_COMMAND_OPTIONS   "@MEMORYCHECK_COMMAND_OPTIONS@")
+SET(CTEST_COVERAGE_COMMAND              "@COVERAGE_COMMAND@")
+SET(CTEST_NOTES_FILES                   "${CTEST_SCRIPT_DIRECTORY}/${CTEST_SCRIPT_NAME}")
+SET(CTEST_TEST_TIMEOUT                  2)
+
+CTEST_START(Experimental)
+CTEST_CONFIGURE(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_BUILD(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)
+CTEST_TEST(BUILD "${CTEST_BINARY_DIRECTORY}" RETURN_VALUE res)

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

Summary of changes:
 Source/CTest/cmCTestRunTest.cxx                    |   11 +++-
 Source/CTest/cmCTestRunTest.h                      |    4 +-
 Source/CTest/cmCTestTestHandler.cxx                |    2 +
 Source/CTest/cmCTestTestHandler.h                  |    1 +
 Tests/CMakeLists.txt                               |   57 ++++++++++++--------
 Tests/CTestTestZeroTimeout/CMakeLists.txt          |    8 +++
 .../CTestConfig.cmake                              |    2 +-
 .../sleep.c                                        |    6 +-
 .../test.cmake.in                                  |    7 ++-
 9 files changed, 63 insertions(+), 35 deletions(-)
 create mode 100644 Tests/CTestTestZeroTimeout/CMakeLists.txt
 copy Tests/{CTestTestParallel => CTestTestZeroTimeout}/CTestConfig.cmake (84%)
 copy Tests/{CTestTestCostSerial => CTestTestZeroTimeout}/sleep.c (74%)
 copy Tests/{CTestTestDepends => CTestTestZeroTimeout}/test.cmake.in (86%)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list