[Cmake-commits] CMake branch, next, updated. v2.8.8-2639-gb5f0290

Brad King brad.king at kitware.com
Thu Apr 19 09:35:39 EDT 2012


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  b5f02907649c3f075fcf44225bd259b27262a972 (commit)
       via  38c3943b6fd30cbc684211a1abf73330813dcda1 (commit)
      from  7a6a6109b8a8047e4e137f963e62a2d215bd4315 (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=b5f02907649c3f075fcf44225bd259b27262a972
commit b5f02907649c3f075fcf44225bd259b27262a972
Merge: 7a6a610 38c3943
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Thu Apr 19 09:35:38 2012 -0400
Commit:     CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Apr 19 09:35:38 2012 -0400

    Merge topic 'test-RunCMake-check' into next
    
    38c3943 Teach RunCMake tests to allow custom checks


http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=38c3943b6fd30cbc684211a1abf73330813dcda1
commit 38c3943b6fd30cbc684211a1abf73330813dcda1
Author:     Brad King <brad.king at kitware.com>
AuthorDate: Wed Apr 18 11:09:18 2012 -0400
Commit:     Brad King <brad.king at kitware.com>
CommitDate: Thu Apr 19 08:32:57 2012 -0400

    Teach RunCMake tests to allow custom checks
    
    Look for a <SubTest>-check.cmake script and load it to check side
    effects of the sub test.  Provide it with the test source and build tree
    paths in variables.  Check for a failure message in a result variable.

diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 0b79efa..488d469 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -24,11 +24,16 @@
 # 4.) Create a <SubTest>.cmake file for each sub-test named above
 # containing the actual test code.  Optionally create files
 # containing expected test results:
-#   <SubTest>-result.txt = Process result expected if not "0"
-#   <SubTest>-stdout.txt = Regex matching expected stdout content
-#   <SubTest>-stderr.txt = Regex matching expected stderr content
+#   <SubTest>-result.txt  = Process result expected if not "0"
+#   <SubTest>-stdout.txt  = Regex matching expected stdout content
+#   <SubTest>-stderr.txt  = Regex matching expected stderr content
+#   <SubTest>-check.cmake = Custom result check
 # Note that trailing newlines will be stripped from actual test
 # output before matching against the stdout and stderr expressions.
+# The code in <SubTest>-check.cmake may use variables
+#   RunCMake_TEST_SOURCE_DIR = Top of test source tree
+#   RunCMake_TEST_BINARY_DIR = Top of test binary tree
+# and an failure must store a message in RunCMake_TEST_FAILED.
 
 macro(add_RunCMake_test test)
   add_test(RunCMake.${test} ${CMAKE_CMAKE_COMMAND}
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index 2639463..c3c161a 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -25,14 +25,14 @@ function(run_cmake test)
       unset(expect_std${o})
     endif()
   endforeach()
-  set(source_dir "${top_src}")
-  set(binary_dir "${top_bin}/${test}-build")
-  file(REMOVE_RECURSE "${binary_dir}")
-  file(MAKE_DIRECTORY "${binary_dir}")
+  set(RunCMake_TEST_SOURCE_DIR "${top_src}")
+  set(RunCMake_TEST_BINARY_DIR "${top_bin}/${test}-build")
+  file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+  file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
   execute_process(
-    COMMAND ${CMAKE_COMMAND} "${source_dir}"
+    COMMAND ${CMAKE_COMMAND} "${RunCMake_TEST_SOURCE_DIR}"
               -G "${RunCMake_GENERATOR}" -DRunCMake_TEST=${test}
-    WORKING_DIRECTORY "${binary_dir}"
+    WORKING_DIRECTORY "${RunCMake_TEST_BINARY_DIR}"
     OUTPUT_VARIABLE actual_stdout
     ERROR_VARIABLE actual_stderr
     RESULT_VARIABLE actual_result
@@ -53,6 +53,11 @@ function(run_cmake test)
       endif()
     endif()
   endforeach()
+  unset(RunCMake_TEST_FAILED)
+  include(${top_src}/${test}-check.cmake OPTIONAL)
+  if(RunCMake_TEST_FAILED)
+    set(msg "${RunCMake_TEST_FAILED}\n${msg}")
+  endif()
   if(msg)
     string(REGEX REPLACE "\n" "\n actual-out> " actual_out " actual-out> ${actual_stdout}")
     string(REGEX REPLACE "\n" "\n actual-err> " actual_err " actual-err> ${actual_stderr}")

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

Summary of changes:
 Tests/RunCMake/CMakeLists.txt |   11 ++++++++---
 Tests/RunCMake/RunCMake.cmake |   17 +++++++++++------
 2 files changed, 19 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
CMake


More information about the Cmake-commits mailing list