diff options
author | Brad King <brad.king@kitware.com> | 2019-05-15 13:20:24 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-05-15 13:21:08 (GMT) |
commit | 0064edf4173fad72749da2c66753387e9a671223 (patch) | |
tree | ed3b08a0ecf709ca9281cdea448945bcba957a01 /Tests/RunCMake | |
parent | ac0411f1662f64fe1320e22e5a8906b8a40d6677 (diff) | |
parent | 9f76961de87d8911d13867d469c38087e47a0b60 (diff) | |
download | CMake-0064edf4173fad72749da2c66753387e9a671223.zip CMake-0064edf4173fad72749da2c66753387e9a671223.tar.gz CMake-0064edf4173fad72749da2c66753387e9a671223.tar.bz2 |
Merge topic 'ninja-pool-custom-command'
9f76961de8 Support job pools in custom commands and targets
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3308
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/Ninja/CustomCommandJobPool-check.cmake | 8 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/CustomCommandJobPool.cmake | 17 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/JobPoolUsesTerminal-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/JobPoolUsesTerminal-stderr.txt | 9 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/JobPoolUsesTerminal.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/Ninja/RunCMakeTest.cmake | 2 |
6 files changed, 39 insertions, 0 deletions
diff --git a/Tests/RunCMake/Ninja/CustomCommandJobPool-check.cmake b/Tests/RunCMake/Ninja/CustomCommandJobPool-check.cmake new file mode 100644 index 0000000..7f7fa33 --- /dev/null +++ b/Tests/RunCMake/Ninja/CustomCommandJobPool-check.cmake @@ -0,0 +1,8 @@ +set(log "${RunCMake_BINARY_DIR}/CustomCommandJobPool-build/build.ninja") +file(READ "${log}" build_file) +if(NOT "${build_file}" MATCHES "pool = custom_command_pool") + set(RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected line: pool = custom_command_pool") +endif() +if(NOT "${build_file}" MATCHES "pool = custom_target_pool") + set(RunCMake_TEST_FAILED "Log file:\n ${log}\ndoes not have expected line: pool = custom_target_pool") +endif() diff --git a/Tests/RunCMake/Ninja/CustomCommandJobPool.cmake b/Tests/RunCMake/Ninja/CustomCommandJobPool.cmake new file mode 100644 index 0000000..1e36e65 --- /dev/null +++ b/Tests/RunCMake/Ninja/CustomCommandJobPool.cmake @@ -0,0 +1,17 @@ +add_custom_command( + OUTPUT hello.copy.c + COMMAND "${CMAKE_COMMAND}" -E copy + "${CMAKE_CURRENT_SOURCE_DIR}/hello.c" + hello.copy.c + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + JOB_POOL "custom_command_pool" + ) +add_custom_target(copy ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/hello.copy.c") + +add_custom_target( + hello.echo + COMMAND echo + JOB_POOL "custom_target_pool" +) + +include(CheckNoPrefixSubDir.cmake) diff --git a/Tests/RunCMake/Ninja/JobPoolUsesTerminal-result.txt b/Tests/RunCMake/Ninja/JobPoolUsesTerminal-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Ninja/JobPoolUsesTerminal-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Ninja/JobPoolUsesTerminal-stderr.txt b/Tests/RunCMake/Ninja/JobPoolUsesTerminal-stderr.txt new file mode 100644 index 0000000..45975ca --- /dev/null +++ b/Tests/RunCMake/Ninja/JobPoolUsesTerminal-stderr.txt @@ -0,0 +1,9 @@ +^CMake Error at JobPoolUsesTerminal.cmake:1 \(add_custom_command\): + add_custom_command JOB_POOL is shadowed by USES_TERMINAL. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at JobPoolUsesTerminal.cmake:2 \(add_custom_target\): + add_custom_target JOB_POOL is shadowed by USES_TERMINAL. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\)$ diff --git a/Tests/RunCMake/Ninja/JobPoolUsesTerminal.cmake b/Tests/RunCMake/Ninja/JobPoolUsesTerminal.cmake new file mode 100644 index 0000000..b7e440c --- /dev/null +++ b/Tests/RunCMake/Ninja/JobPoolUsesTerminal.cmake @@ -0,0 +1,2 @@ +add_custom_command(OUTPUT x COMMAND y USES_TERMINAL JOB_POOL z) +add_custom_target(CustomTarget COMMAND y USES_TERMINAL JOB_POOL z) diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake index 8fa650a..808a872 100644 --- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake +++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake @@ -57,6 +57,8 @@ run_CMP0058(NEW-no) run_CMP0058(NEW-by) run_cmake(CustomCommandDepfile) +run_cmake(CustomCommandJobPool) +run_cmake(JobPoolUsesTerminal) run_cmake(RspFileC) run_cmake(RspFileCXX) |