diff options
author | Brad King <brad.king@kitware.com> | 2021-06-09 11:57:27 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-06-09 11:57:34 (GMT) |
commit | e3c420a74fc528a8c0fb671f50d51df4e938c712 (patch) | |
tree | ec139fab86c8284da4b4653d70eef26b2f2d0b38 /Tests/RunCMake | |
parent | 12fc4f1239aeff91aa7563496c13c87c17d81373 (diff) | |
parent | 534c40e6d8801853c19435a8c2d732ca2b01b606 (diff) | |
download | CMake-e3c420a74fc528a8c0fb671f50d51df4e938c712.zip CMake-e3c420a74fc528a8c0fb671f50d51df4e938c712.tar.gz CMake-e3c420a74fc528a8c0fb671f50d51df4e938c712.tar.bz2 |
Merge topic 'presets-build-fixes' into release-3.20
534c40e6d8 presets: Fix buildPreset "targets" not allowing a single string
5d67632813 presets: Fix buildPreset "jobs"
93e396b402 presets: Fix buildPreset "jobs" field test case
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !6190
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 16 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresetsBuild/Good.json.in | 7 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake | 10 |
3 files changed, 28 insertions, 5 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 78e0b6a..c81796c 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -809,9 +809,19 @@ add_RunCMake_test(PrecompileHeaders -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID} -DCMAKE_C_COMPILER_VERSION=${CMAKE_C_COMPILER_VERSION}) add_RunCMake_test("UnityBuild") -add_RunCMake_test(CMakePresets -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}) -add_RunCMake_test(CMakePresetsBuild -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}) -add_RunCMake_test(CMakePresetsTest -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA}) +add_RunCMake_test(CMakePresets + -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA} + ) +add_RunCMake_test(CMakePresetsBuild + -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA} + -DCMAKE_SYSTEM_NAME=${CMAKE_SYSTEM_NAME} + ) +add_RunCMake_test(CMakePresetsTest + -DPYTHON_EXECUTABLE=${PYTHON_EXECUTABLE} + -DCMake_TEST_JSON_SCHEMA=${CMake_TEST_JSON_SCHEMA} + ) if(${CMAKE_GENERATOR} MATCHES "Make|Ninja") add_RunCMake_test(TransformDepfile) diff --git a/Tests/RunCMake/CMakePresetsBuild/Good.json.in b/Tests/RunCMake/CMakePresetsBuild/Good.json.in index fd43c4e..c7f318c 100644 --- a/Tests/RunCMake/CMakePresetsBuild/Good.json.in +++ b/Tests/RunCMake/CMakePresetsBuild/Good.json.in @@ -30,7 +30,7 @@ "description": "", "inheritConfigureEnvironment": true, "environment": {}, - "jobs": 0, + @Good_json_jobs@ "targets": [], "configuration": "", "verbose": true, @@ -73,6 +73,11 @@ "vendor": { "example.com": "value" } + }, + { + "name": "singleTarget", + "inherits": "build-default", + "targets": "good" } ] } diff --git a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake index 2559b12..a05ad9f 100644 --- a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake @@ -62,7 +62,15 @@ endfunction() set(CMakePresets_SCHEMA_EXPECTED_RESULT 0) -run_cmake_build_presets(Good "default;other" "build-other;withEnvironment;noEnvironment;macros;vendorObject") +if(RunCMake_GENERATOR MATCHES "NMake|Borland|Watcom") + set(Good_json_jobs [[]]) +elseif(RunCMake_GENERATOR MATCHES "Make" AND CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + set(Good_json_jobs [["jobs": 1,]]) +else() + set(Good_json_jobs [["jobs": 0,]]) +endif() + +run_cmake_build_presets(Good "default;other" "build-other;withEnvironment;noEnvironment;macros;vendorObject;singleTarget") run_cmake_build_presets(InvalidConfigurePreset "default" "badConfigurePreset") set(CMakePresetsBuild_BUILD_ONLY 1) |