diff options
author | Brad King <brad.king@kitware.com> | 2020-07-09 10:53:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-07-09 10:53:36 (GMT) |
commit | 43372d5ba34d2a95a886f39a254870c122e98fa2 (patch) | |
tree | 5319a4ae051bddf793f62e38763cd49ecc465e7b /Tests | |
parent | a054211dd9009116605c240d6599e2bc544b524e (diff) | |
parent | 4d40253f1cbb261aa469411a3c2a7ffc2ef761a4 (diff) | |
download | CMake-43372d5ba34d2a95a886f39a254870c122e98fa2.zip CMake-43372d5ba34d2a95a886f39a254870c122e98fa2.tar.gz CMake-43372d5ba34d2a95a886f39a254870c122e98fa2.tar.bz2 |
Merge topic 'file-GENERATE-tmp'
4d40253f1c Tests: Cover file(GENERATE) using 'foo.tmp' as input for output 'foo'
eaa420e99c cmGeneratedFileStream: Use random temporary file extension by default
09ff1cb650 cmCTest: Explicitly specify '.tmp' extension on in-progress log files
0d3a034725 cmGeneratedFileStream: Optionally use custom temporary file extension
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4992
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/File_Generate/AdjacentInOut.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/File_Generate/AdjacentInOut.in | 1 | ||||
-rw-r--r-- | Tests/RunCMake/File_Generate/RunCMakeTest.cmake | 8 |
3 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/File_Generate/AdjacentInOut.cmake b/Tests/RunCMake/File_Generate/AdjacentInOut.cmake new file mode 100644 index 0000000..828c2ee --- /dev/null +++ b/Tests/RunCMake/File_Generate/AdjacentInOut.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0070 NEW) +if(EXISTS "${CMAKE_CURRENT_BINARY_DIR}/AdjacentInOut.txt") + message(FATAL_ERROR "CMake should not re-run during the build!") +endif() +configure_file(AdjacentInOut.in ${CMAKE_CURRENT_BINARY_DIR}/AdjacentInOut.txt.tmp) +file(GENERATE OUTPUT AdjacentInOut.txt INPUT ${CMAKE_CURRENT_BINARY_DIR}/AdjacentInOut.txt.tmp) diff --git a/Tests/RunCMake/File_Generate/AdjacentInOut.in b/Tests/RunCMake/File_Generate/AdjacentInOut.in new file mode 100644 index 0000000..bfbbda7 --- /dev/null +++ b/Tests/RunCMake/File_Generate/AdjacentInOut.in @@ -0,0 +1 @@ +Sample Text File diff --git a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake index 94aaca8..5987417 100644 --- a/Tests/RunCMake/File_Generate/RunCMakeTest.cmake +++ b/Tests/RunCMake/File_Generate/RunCMakeTest.cmake @@ -72,6 +72,7 @@ if (UNIX AND EXISTS /bin/sh) if (NOT script_output STREQUAL SUCCESS) message(SEND_ERROR "Generated script did not execute correctly:\n${script_output}\n====\n${script_error}") endif() + unset(RunCMake_TEST_NO_CLEAN) endif() if (RunCMake_GENERATOR MATCHES Makefiles) @@ -104,3 +105,10 @@ if (RunCMake_GENERATOR MATCHES Makefiles) message(SEND_ERROR "File did not re-generate: \"${RunCMake_BINARY_DIR}/ReRunCMake-build/output_file.txt\"") endif() endif() + +set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/AdjacentInOut-build) +run_cmake(AdjacentInOut) +set(RunCMake_TEST_NO_CLEAN 1) +run_cmake_command(AdjacentInOut-nowork ${CMAKE_COMMAND} --build .) +unset(RunCMake_TEST_BINARY_DIR) +unset(RunCMake_TEST_NO_CLEAN) |