diff options
Diffstat (limited to 'Tests/RunCMake')
13 files changed, 63 insertions, 4 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 470f30291..ec4c7b5a4 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -143,14 +143,14 @@ if(CMAKE_GENERATOR MATCHES "Ninja") list(APPEND Ninja_ARGS -DTEST_Fortran=1) endif() if(CMake_TEST_Qt5 AND Qt5Core_FOUND) - list(APPEND Ninja_ARGS -DCMake_TEST_Qt5=1 -DCMAKE_TEST_Qt5Core_Version=${Qt5Core_VERSION}) + list(APPEND Ninja_ARGS -DCMake_TEST_Qt5=1 -DQt5Core_DIR=${Qt5Core_DIR} -DCMAKE_TEST_Qt5Core_Version=${Qt5Core_VERSION}) endif() add_RunCMake_test(Ninja) set(NinjaMultiConfig_ARGS -DCYGWIN=${CYGWIN} ) if(CMake_TEST_Qt5 AND Qt5Core_FOUND) - list(APPEND NinjaMultiConfig_ARGS -DCMake_TEST_Qt5=1) + list(APPEND NinjaMultiConfig_ARGS -DCMake_TEST_Qt5=1 -DQt5Core_DIR=${Qt5Core_DIR} -DCMAKE_TEST_Qt5Core_Version=${Qt5Core_VERSION}) endif() if(DEFINED CMake_TEST_CUDA) list(APPEND NinjaMultiConfig_ARGS -DCMake_TEST_CUDA=${CMake_TEST_CUDA}) diff --git a/Tests/RunCMake/Ninja/RunCMakeTest.cmake b/Tests/RunCMake/Ninja/RunCMakeTest.cmake index d43023b6e..e6f86a1a9 100644 --- a/Tests/RunCMake/Ninja/RunCMakeTest.cmake +++ b/Tests/RunCMake/Ninja/RunCMakeTest.cmake @@ -327,6 +327,7 @@ run_ChangeBuildType() function(run_Qt5AutoMocDeps) if(CMake_TEST_Qt5 AND CMAKE_TEST_Qt5Core_Version VERSION_GREATER_EQUAL 5.15.0) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Qt5AutoMocDeps-build) + set(RunCMake_TEST_OPTIONS "-DQt5Core_DIR=${Qt5Core_DIR}") run_cmake(Qt5AutoMocDeps) unset(RunCMake_TEST_OPTIONS) # Build the project. diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-clean-build-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-clean-build-check.cmake new file mode 100644 index 000000000..a6eb08857 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-clean-build-check.cmake @@ -0,0 +1,3 @@ +check_files("${RunCMake_TEST_BINARY_DIR}" + INCLUDE + ) diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-leaf-byproduct-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-leaf-byproduct-ninja-check.cmake new file mode 100644 index 000000000..b2d67b47d --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-leaf-byproduct-ninja-check.cmake @@ -0,0 +1,5 @@ +check_files("${RunCMake_TEST_BINARY_DIR}" + INCLUDE + ${TARGET_BYPRODUCTS_LeafExe} + ${TARGET_BYPRODUCTS_RootCustom} + ) diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-leaf-custom-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-leaf-custom-ninja-check.cmake new file mode 100644 index 000000000..b142ed267 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-leaf-custom-ninja-check.cmake @@ -0,0 +1,6 @@ +check_files("${RunCMake_TEST_BINARY_DIR}" + INCLUDE + ${TARGET_BYPRODUCTS_LeafCustom} + ${TARGET_BYPRODUCTS_RootCustom} + ${TARGET_FILE_RootExe_Release} + ) diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-leaf-exe-ninja-check.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-leaf-exe-ninja-check.cmake new file mode 100644 index 000000000..e29dab678 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets-release-leaf-exe-ninja-check.cmake @@ -0,0 +1,7 @@ +check_files("${RunCMake_TEST_BINARY_DIR}" + INCLUDE + ${TARGET_FILE_LeafExe_Release} + ${TARGET_BYPRODUCTS_LeafExe} + ${TARGET_BYPRODUCTS_RootCustom} + ${TARGET_FILE_RootExe_Release} + ) diff --git a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake index b2b24e81a..7bed09090 100644 --- a/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/CustomCommandsAndTargets.cmake @@ -34,6 +34,18 @@ add_subdirectory(CustomCommandsAndTargetsSubdir) create_targets(Top) +add_executable(RootExe main.c) +add_custom_target(RootCustom COMMAND ${CMAKE_COMMAND} -E touch RootCustom.txt BYPRODUCTS RootCustom.txt) +add_custom_command(OUTPUT main.c COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/main.c ${CMAKE_CURRENT_BINARY_DIR}/main.c DEPENDS RootCustom) +add_executable(LeafExe ${CMAKE_CURRENT_BINARY_DIR}/main.c) +add_custom_target(LeafCustom COMMAND ${CMAKE_COMMAND} -E touch LeafCustom.txt BYPRODUCTS LeafCustom.txt DEPENDS RootCustom RootExe) +add_dependencies(LeafExe RootExe) +file(APPEND "${CMAKE_BINARY_DIR}/target_files_custom.cmake" +"set(TARGET_BYPRODUCTS_LeafCustom [==[${CMAKE_CURRENT_BINARY_DIR}/LeafCustom.txt]==]) +set(TARGET_BYPRODUCTS_LeafExe [==[${CMAKE_CURRENT_BINARY_DIR}/main.c]==]) +set(TARGET_BYPRODUCTS_RootCustom [==[${CMAKE_CURRENT_BINARY_DIR}/RootCustom.txt]==]) +") + include(${CMAKE_CURRENT_LIST_DIR}/Common.cmake) -generate_output_files(TopPostBuild SubdirPostBuild) +generate_output_files(TopPostBuild SubdirPostBuild RootExe LeafExe) file(APPEND "${CMAKE_BINARY_DIR}/target_files.cmake" "include(\${CMAKE_CURRENT_LIST_DIR}/target_files_custom.cmake)\n") diff --git a/Tests/RunCMake/NinjaMultiConfig/Qt5-automoc-check-ninja-stdout.txt b/Tests/RunCMake/NinjaMultiConfig/Qt5-automoc-check-ninja-stdout.txt new file mode 100644 index 000000000..85d5fdc75 --- /dev/null +++ b/Tests/RunCMake/NinjaMultiConfig/Qt5-automoc-check-ninja-stdout.txt @@ -0,0 +1,7 @@ + input: CUSTOM_COMMAND( + [^ +]*)* + \|\| exe_autogen_timestamp_deps:Debug( + [^ +]*)* + outputs: diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake index 76b488ebb..0aef2b9f1 100644 --- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake @@ -235,6 +235,12 @@ run_cmake_build(CustomCommandsAndTargets debug-in-release-graph-postbuild Releas run_ninja(CustomCommandsAndTargets release-postbuild build-Release.ninja SubdirPostBuild) run_cmake_build(CustomCommandsAndTargets debug-targetpostbuild Debug TopTargetPostBuild) run_ninja(CustomCommandsAndTargets release-targetpostbuild build-Release.ninja SubdirTargetPostBuild) +run_cmake_build(CustomCommandsAndTargets release-clean Release clean:all) +run_ninja(CustomCommandsAndTargets release-leaf-custom build-Release.ninja LeafCustom.txt) +run_cmake_build(CustomCommandsAndTargets release-clean Release clean:all) +run_ninja(CustomCommandsAndTargets release-leaf-exe build-Release.ninja LeafExe) +run_cmake_build(CustomCommandsAndTargets release-clean Release clean:all) +run_ninja(CustomCommandsAndTargets release-leaf-byproduct build-Release.ninja main.c) unset(RunCMake_TEST_BINARY_DIR) @@ -300,9 +306,12 @@ endif() if(CMake_TEST_Qt5) set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/Qt5-build) - set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSS_CONFIGS=all") + set(RunCMake_TEST_OPTIONS "-DCMAKE_CROSS_CONFIGS=all" "-DQt5Core_DIR=${Qt5Core_DIR}") run_cmake_configure(Qt5) unset(RunCMake_TEST_OPTIONS) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) run_cmake_build(Qt5 debug-in-release-graph Release exe:Debug) + if(CMAKE_TEST_Qt5Core_Version VERSION_GREATER_EQUAL 5.15.0) + run_ninja(Qt5 automoc-check build-Debug.ninja -t query exe_autogen/timestamp) + endif() endif() diff --git a/Tests/RunCMake/foreach/RunCMakeTest.cmake b/Tests/RunCMake/foreach/RunCMakeTest.cmake index 22a0a753d..d3f7c231c 100644 --- a/Tests/RunCMake/foreach/RunCMakeTest.cmake +++ b/Tests/RunCMake/foreach/RunCMakeTest.cmake @@ -19,3 +19,4 @@ run_cmake(foreach-RANGE-non-int-test-3-1) run_cmake(foreach-RANGE-non-int-test-3-2) run_cmake(foreach-RANGE-non-int-test-3-3) run_cmake(foreach-RANGE-invalid-test) +run_cmake(foreach-RANGE-out-of-range-test) diff --git a/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-result.txt b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-result.txt new file mode 100644 index 000000000..d00491fd7 --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-stderr.txt b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-stderr.txt new file mode 100644 index 000000000..f05f864d0 --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test-stderr.txt @@ -0,0 +1,4 @@ +^CMake Error at foreach-RANGE-out-of-range-test\.cmake:[0-9]+ \(foreach\): + foreach Integer out of range: '10000000000000000000' +Call Stack \(most recent call first\): + CMakeLists\.txt:3 \(include\)$ diff --git a/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test.cmake b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test.cmake new file mode 100644 index 000000000..3099ca957 --- /dev/null +++ b/Tests/RunCMake/foreach/foreach-RANGE-out-of-range-test.cmake @@ -0,0 +1,3 @@ +foreach(a RANGE 10000000000000000000) + break() +endforeach() |