[Cmake-commits] CMake branch, next, updated. v3.1.1-2383-g86a7940
Brad King
brad.king at kitware.com
Tue Jan 27 11:19:03 EST 2015
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 86a7940fe1fc85caec68f51599a4ec403534e3ad (commit)
via 7f2dc8dc54fa6486423477dd673725bc40d3fdeb (commit)
via daf95a38277f4c732987933a63143dde77dd0a10 (commit)
via bf05938b8f186c397c918c1cf8bd9ce853c86123 (commit)
from d39e049069f3214ec70117a5f865ff9968914b33 (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=86a7940fe1fc85caec68f51599a4ec403534e3ad
commit 86a7940fe1fc85caec68f51599a4ec403534e3ad
Merge: d39e049 7f2dc8d
Author: Brad King <brad.king at kitware.com>
AuthorDate: Tue Jan 27 11:19:02 2015 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Tue Jan 27 11:19:02 2015 -0500
Merge topic 'test-rerun-cmake' into next
7f2dc8dc configure_file: Test that CMake re-runs on input change or output missing
daf95a38 try_compile: Test that CMake re-runs on input change
bf05938b Tests/RunCMake: Normalize newlines before checking actual output
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7f2dc8dc54fa6486423477dd673725bc40d3fdeb
commit 7f2dc8dc54fa6486423477dd673725bc40d3fdeb
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 23 10:02:04 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 27 11:18:37 2015 -0500
configure_file: Test that CMake re-runs on input change or output missing
With the Makefile generators we expect that touching or modifying the
input file of a configure_file, or removing its output, will cause CMake
to re-run on the next build. Extend the RunCMake.configure_file test
with a case covering this. Also check that CMake does not re-run if
nothing has changed.
diff --git a/Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt b/Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt
new file mode 100644
index 0000000..26e07b6
--- /dev/null
+++ b/Tests/RunCMake/configure_file/RerunCMake-rerun-stderr.txt
@@ -0,0 +1 @@
+^Running CMake on RerunCMake$
diff --git a/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt
new file mode 100644
index 0000000..34c873c
--- /dev/null
+++ b/Tests/RunCMake/configure_file/RerunCMake-rerun-stdout.txt
@@ -0,0 +1,3 @@
+-- Configuring done
+-- Generating done
+-- Build files have been written to: .*/Tests/RunCMake/configure_file/RerunCMake-build
diff --git a/Tests/RunCMake/configure_file/RerunCMake-stderr.txt b/Tests/RunCMake/configure_file/RerunCMake-stderr.txt
new file mode 100644
index 0000000..26e07b6
--- /dev/null
+++ b/Tests/RunCMake/configure_file/RerunCMake-stderr.txt
@@ -0,0 +1 @@
+^Running CMake on RerunCMake$
diff --git a/Tests/RunCMake/configure_file/RerunCMake-stdout.txt b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt
new file mode 100644
index 0000000..34c873c
--- /dev/null
+++ b/Tests/RunCMake/configure_file/RerunCMake-stdout.txt
@@ -0,0 +1,3 @@
+-- Configuring done
+-- Generating done
+-- Build files have been written to: .*/Tests/RunCMake/configure_file/RerunCMake-build
diff --git a/Tests/RunCMake/configure_file/RerunCMake.cmake b/Tests/RunCMake/configure_file/RerunCMake.cmake
new file mode 100644
index 0000000..890cc1f
--- /dev/null
+++ b/Tests/RunCMake/configure_file/RerunCMake.cmake
@@ -0,0 +1,8 @@
+message("Running CMake on RerunCMake") # write to stderr if cmake reruns
+configure_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileInput.txt.in"
+ "${CMAKE_CURRENT_BINARY_DIR}/ConfigureFileOutput.txt"
+ @ONLY
+ )
+# make sure CMakeCache.txt is newer than ConfigureFileOutput.txt
+execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1)
diff --git a/Tests/RunCMake/configure_file/RunCMakeTest.cmake b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
index c010256..489652b 100644
--- a/Tests/RunCMake/configure_file/RunCMakeTest.cmake
+++ b/Tests/RunCMake/configure_file/RunCMakeTest.cmake
@@ -7,3 +7,37 @@ run_cmake(UTF16BE-BOM)
run_cmake(UTF32LE-BOM)
run_cmake(UTF32BE-BOM)
run_cmake(UnknownArg)
+
+if(RunCMake_GENERATOR MATCHES "Make")
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ set(in_conf "${RunCMake_TEST_BINARY_DIR}/ConfigureFileInput.txt.in")
+ file(WRITE "${in_conf}" "1")
+
+ message(STATUS "RerunCMake: first configuration...")
+ run_cmake(RerunCMake)
+ run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .)
+
+ execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution
+ message(STATUS "RerunCMake: touch configure_file input...")
+ file(WRITE "${in_conf}" "1")
+ run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .)
+ run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .)
+
+ execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution
+ message(STATUS "RerunCMake: modify configure_file input...")
+ file(WRITE "${in_conf}" "2")
+ run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .)
+ run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .)
+
+ message(STATUS "RerunCMake: remove configure_file output...")
+ file(REMOVE "${RunCMake_TEST_BINARY_DIR}/ConfigureFileOutput.txt")
+ run_cmake_command(RerunCMake-rerun ${CMAKE_COMMAND} --build .)
+ run_cmake_command(RerunCMake-nowork ${CMAKE_COMMAND} --build .)
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+endif()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=daf95a38277f4c732987933a63143dde77dd0a10
commit daf95a38277f4c732987933a63143dde77dd0a10
Author: Brad King <brad.king at kitware.com>
AuthorDate: Fri Jan 23 09:45:00 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 27 11:18:36 2015 -0500
try_compile: Test that CMake re-runs on input change
With the Makefile and Ninja generators we expect that touching the input
source file for a try_compile will cause CMake to re-run on the next
build. Extend the RunCMake.try_compile test with a case covering this.
Also check that CMake does not re-run if nothing has changed.
diff --git a/Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt
new file mode 100644
index 0000000..e600b9b
--- /dev/null
+++ b/Tests/RunCMake/try_compile/RerunCMake-nowork-ninja-no-console-stdout.txt
@@ -0,0 +1 @@
+^ninja: no work to do\.$
diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt
new file mode 100644
index 0000000..b0438f5
--- /dev/null
+++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-ninja-no-console-stdout.txt
@@ -0,0 +1,5 @@
+Running CMake on RerunCMake
+FALSE
+-- Configuring done
+-- Generating done
+-- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build
diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt
new file mode 100644
index 0000000..88e54b1
--- /dev/null
+++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-stderr.txt
@@ -0,0 +1,2 @@
+^Running CMake on RerunCMake
+FALSE$
diff --git a/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt
new file mode 100644
index 0000000..9c78b26
--- /dev/null
+++ b/Tests/RunCMake/try_compile/RerunCMake-rerun-stdout.txt
@@ -0,0 +1,3 @@
+-- Configuring done
+-- Generating done
+-- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build
diff --git a/Tests/RunCMake/try_compile/RerunCMake-stderr.txt b/Tests/RunCMake/try_compile/RerunCMake-stderr.txt
new file mode 100644
index 0000000..45d305a
--- /dev/null
+++ b/Tests/RunCMake/try_compile/RerunCMake-stderr.txt
@@ -0,0 +1,2 @@
+^Running CMake on RerunCMake
+TRUE$
diff --git a/Tests/RunCMake/try_compile/RerunCMake-stdout.txt b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt
new file mode 100644
index 0000000..9c78b26
--- /dev/null
+++ b/Tests/RunCMake/try_compile/RerunCMake-stdout.txt
@@ -0,0 +1,3 @@
+-- Configuring done
+-- Generating done
+-- Build files have been written to: .*/Tests/RunCMake/try_compile/RerunCMake-build
diff --git a/Tests/RunCMake/try_compile/RerunCMake.cmake b/Tests/RunCMake/try_compile/RerunCMake.cmake
new file mode 100644
index 0000000..5a9f1d4
--- /dev/null
+++ b/Tests/RunCMake/try_compile/RerunCMake.cmake
@@ -0,0 +1,7 @@
+message("Running CMake on RerunCMake") # write to stderr if cmake reruns
+enable_language(C)
+try_compile(res
+ "${CMAKE_CURRENT_BINARY_DIR}"
+ SOURCES "${CMAKE_CURRENT_BINARY_DIR}/TryCompileInput.c"
+ )
+message("${res}")
diff --git a/Tests/RunCMake/try_compile/RunCMakeTest.cmake b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
index 06096b2..6cdbafa 100644
--- a/Tests/RunCMake/try_compile/RunCMakeTest.cmake
+++ b/Tests/RunCMake/try_compile/RunCMakeTest.cmake
@@ -17,3 +17,36 @@ run_cmake(NonSourceCopyFile)
run_cmake(NonSourceCompileDefinitions)
run_cmake(CMP0056)
+
+if(RunCMake_GENERATOR MATCHES "Make|Ninja")
+ # Use a single build tree for a few tests without cleaning.
+ set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/RerunCMake-build)
+ set(RunCMake_TEST_NO_CLEAN 1)
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ set(in_tc "${RunCMake_TEST_BINARY_DIR}/TryCompileInput.c")
+ file(WRITE "${in_tc}" "int main(void) { return 0; }\n")
+
+ # Older Ninja keeps all rerun output on stdout
+ set(ninja "")
+ if(RunCMake_GENERATOR STREQUAL "Ninja")
+ execute_process(COMMAND ${RunCMake_MAKE_PROGRAM} --version
+ OUTPUT_VARIABLE ninja_version OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(ninja_version VERSION_LESS 1.5)
+ set(ninja -ninja-no-console)
+ endif()
+ endif()
+
+ message(STATUS "RerunCMake: first configuration...")
+ run_cmake(RerunCMake)
+ run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
+
+ execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 1) # handle 1s resolution
+ message(STATUS "RerunCMake: modify try_compile input...")
+ file(WRITE "${in_tc}" "does-not-compile\n")
+ run_cmake_command(RerunCMake-rerun${ninja} ${CMAKE_COMMAND} --build .)
+ run_cmake_command(RerunCMake-nowork${ninja} ${CMAKE_COMMAND} --build .)
+
+ unset(RunCMake_TEST_BINARY_DIR)
+ unset(RunCMake_TEST_NO_CLEAN)
+endif()
http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=bf05938b8f186c397c918c1cf8bd9ce853c86123
commit bf05938b8f186c397c918c1cf8bd9ce853c86123
Author: Brad King <brad.king at kitware.com>
AuthorDate: Mon Jan 26 13:41:38 2015 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Tue Jan 27 11:18:36 2015 -0500
Tests/RunCMake: Normalize newlines before checking actual output
We read the expected output with file(STRINGS) which converts CRLF
newlines to LF. Do the same with the actual output before comparing.
diff --git a/Tests/RunCMake/RunCMake.cmake b/Tests/RunCMake/RunCMake.cmake
index 23f2f97..33b745d 100644
--- a/Tests/RunCMake/RunCMake.cmake
+++ b/Tests/RunCMake/RunCMake.cmake
@@ -79,6 +79,7 @@ function(run_cmake test)
set(msg "${msg}Result is [${actual_result}], not [${expect_result}].\n")
endif()
foreach(o out err)
+ string(REGEX REPLACE "\r\n" "\n" actual_std${o} "${actual_std${o}}")
string(REGEX REPLACE "(^|\n)(==[0-9]+==[^\n]*\n)+" "\\1" actual_std${o} "${actual_std${o}}")
string(REGEX REPLACE "\n+$" "" actual_std${o} "${actual_std${o}}")
set(expect_${o} "")
-----------------------------------------------------------------------
Summary of changes:
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list