diff options
author | Brad King <brad.king@kitware.com> | 2021-06-08 11:09:31 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-06-08 11:47:20 (GMT) |
commit | 93e396b402d8736bd3c7a0a9b61113ceff819144 (patch) | |
tree | 11feee8b9333d6f6a354650a9a10843b89a967cd /Tests | |
parent | 13d112ea03f2b068da1f7ac3239a42a6cff94eda (diff) | |
download | CMake-93e396b402d8736bd3c7a0a9b61113ceff819144.zip CMake-93e396b402d8736bd3c7a0a9b61113ceff819144.tar.gz CMake-93e396b402d8736bd3c7a0a9b61113ceff819144.tar.bz2 |
presets: Fix buildPreset "jobs" field test case
Avoid passing parallel build options to Make tools that do not support
them.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 16 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresetsBuild/Good.json.in | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake | 8 |
3 files changed, 22 insertions, 4 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..8acd6f4 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, diff --git a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake index 2559b12..f6ca6c5 100644 --- a/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresetsBuild/RunCMakeTest.cmake @@ -62,6 +62,14 @@ endfunction() set(CMakePresets_SCHEMA_EXPECTED_RESULT 0) +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") run_cmake_build_presets(InvalidConfigurePreset "default" "badConfigurePreset") |