diff options
author | Craig Scott <craig.scott@crascit.com> | 2020-10-23 10:37:47 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-10-23 10:37:56 (GMT) |
commit | 5e1858c0c2d819412f2ce0ff8e681f54df42ffe6 (patch) | |
tree | 4f9f893e97b239b4f469159c8bca9e5b5dbc71d2 /Tests | |
parent | 761dc324e043a504f6cec26b03bd86eb59c48710 (diff) | |
parent | 64afabdbcb265acb53a9b8f8cb86465d31f2ca61 (diff) | |
download | CMake-5e1858c0c2d819412f2ce0ff8e681f54df42ffe6.zip CMake-5e1858c0c2d819412f2ce0ff8e681f54df42ffe6.tar.gz CMake-5e1858c0c2d819412f2ce0ff8e681f54df42ffe6.tar.bz2 |
Merge topic 'cmake-presets-toolset-arch-config' into release-3.19
64afabdbcb CMakePresets.json: Split cmakeGeneratorConfig field
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5387
Diffstat (limited to 'Tests')
24 files changed, 90 insertions, 33 deletions
diff --git a/Tests/CMakeGUI/QCMakePresetComboBoxTest.cxx b/Tests/CMakeGUI/QCMakePresetComboBoxTest.cxx index 6ee55c3..a95d008 100644 --- a/Tests/CMakeGUI/QCMakePresetComboBoxTest.cxx +++ b/Tests/CMakeGUI/QCMakePresetComboBoxTest.cxx @@ -24,8 +24,9 @@ void QCMakePresetComboBoxTest::changePresets() /*description=*/"", /*generator=*/"Ninja", /*architecture=*/"", + /*setArchitecture=*/true, /*toolset=*/"", - /*setGenConfig=*/true, + /*setToolset=*/true, /*enabled=*/true, }, }); @@ -48,8 +49,9 @@ void QCMakePresetComboBoxTest::changePresets() /*description=*/"", /*generator=*/"Ninja Multi-Config", /*architecture=*/"", + /*setArchitecture=*/true, /*toolset=*/"", - /*setGenConfig=*/true, + /*setToolset=*/true, /*enabled=*/true, }, }); diff --git a/Tests/CMakeGUI/QCMakePresetItemModelTest.cxx b/Tests/CMakeGUI/QCMakePresetItemModelTest.cxx index ee45d39..97dbb30 100644 --- a/Tests/CMakeGUI/QCMakePresetItemModelTest.cxx +++ b/Tests/CMakeGUI/QCMakePresetItemModelTest.cxx @@ -32,8 +32,9 @@ void QCMakePresetItemModelTest::initTestCase_data() /*description=*/"", /*generator=*/"", /*architecture=*/"", + /*setArchitecture=*/true, /*toolset=*/"", - /*setGenConfig=*/true, + /*setToolset=*/true, /*enabled=*/true, }, QCMakePreset{ @@ -42,8 +43,9 @@ void QCMakePresetItemModelTest::initTestCase_data() /*description=*/"", /*generator=*/"", /*architecture=*/"", + /*setArchitecture=*/true, /*toolset=*/"", - /*setGenConfig=*/true, + /*setToolset=*/true, /*enabled=*/true, }, QCMakePreset{ @@ -52,8 +54,9 @@ void QCMakePresetItemModelTest::initTestCase_data() /*description=*/"Long Description", /*generator=*/"", /*architecture=*/"", + /*setArchitecture=*/true, /*toolset=*/"", - /*setGenConfig=*/true, + /*setToolset=*/true, /*enabled=*/true, }, QCMakePreset{ @@ -62,8 +65,9 @@ void QCMakePresetItemModelTest::initTestCase_data() /*description=*/"", /*generator=*/"", /*architecture=*/"", + /*setArchitecture=*/true, /*toolset=*/"", - /*setGenConfig=*/true, + /*setToolset=*/true, /*enabled=*/false, }, }; diff --git a/Tests/CMakeGUI/QCMakePresetTest.cxx b/Tests/CMakeGUI/QCMakePresetTest.cxx index 8fd07e7..2081055 100644 --- a/Tests/CMakeGUI/QCMakePresetTest.cxx +++ b/Tests/CMakeGUI/QCMakePresetTest.cxx @@ -16,8 +16,9 @@ QCMakePreset makePreset() /*description=*/"description", /*generator=*/"generator", /*architecture=*/"architecture", + /*setArchitecture=*/true, /*toolset=*/"toolset", - /*setGenConfig=*/true, + /*setToolset=*/true, /*enabled=*/true, }; } @@ -69,12 +70,14 @@ void QCMakePresetTest::equality_data() QTest::newRow("architecture") << makePreset(&QCMakePreset::architecture, "other-architecture") << false << true << false; + QTest::newRow("setArchitecture") + << makePreset(&QCMakePreset::setArchitecture, false) << false << false + << true; QTest::newRow("toolset") << makePreset(&QCMakePreset::toolset, "other-toolset") << false << false << true; - QTest::newRow("setGenConfig") - << makePreset(&QCMakePreset::setGenConfig, false) << false << false - << true; + QTest::newRow("setToolset") + << makePreset(&QCMakePreset::setToolset, false) << false << false << true; QTest::newRow("enabled") << makePreset(&QCMakePreset::enabled, false) << false << false << true; } diff --git a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-result.txt b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyDefault-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-result.txt +++ b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyDefault-result.txt diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-stderr.txt b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyDefault-stderr.txt index a3b79b6..a3b79b6 100644 --- a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-stderr.txt +++ b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyDefault-stderr.txt diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigIgnore.cmake b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyIgnore.cmake index e69de29..e69de29 100644 --- a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigIgnore.cmake +++ b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyIgnore.cmake diff --git a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-result.txt b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyNone-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-result.txt +++ b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyNone-result.txt diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-stderr.txt b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyNone-stderr.txt index a3b79b6..a3b79b6 100644 --- a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-stderr.txt +++ b/Tests/RunCMake/CMakePresets/ArchToolsetStrategyNone-stderr.txt diff --git a/Tests/RunCMake/CMakePresets/CMakePresets.json.in b/Tests/RunCMake/CMakePresets/CMakePresets.json.in index 3ad667c..a8f89ff 100644 --- a/Tests/RunCMake/CMakePresets/CMakePresets.json.in +++ b/Tests/RunCMake/CMakePresets/CMakePresets.json.in @@ -452,28 +452,38 @@ "binaryDir": "${sourceDir}/build" }, { - "name": "CMakeGeneratorConfigNone", + "name": "ArchToolsetStrategyNone", "generator": "@RunCMake_GENERATOR@", "architecture": "a", "toolset": "a", "binaryDir": "${sourceDir}/build" }, { - "name": "CMakeGeneratorConfigBase", + "name": "ArchToolsetStrategyBase", "generator": "@RunCMake_GENERATOR@", - "architecture": "a", - "toolset": "a", - "cmakeGeneratorConfig": "ignore", + "architecture": { + "value": "a", + "strategy": "external" + }, + "toolset": { + "value": "a", + "strategy": "external" + }, "binaryDir": "${sourceDir}/build" }, { - "name": "CMakeGeneratorConfigDefault", - "inherits": "CMakeGeneratorConfigBase", - "cmakeGeneratorConfig": "default" + "name": "ArchToolsetStrategyDefault", + "inherits": "ArchToolsetStrategyBase", + "architecture": { + "strategy": "set" + }, + "toolset": { + "strategy": "set" + } }, { - "name": "CMakeGeneratorConfigIgnore", - "inherits": "CMakeGeneratorConfigBase" + "name": "ArchToolsetStrategyIgnore", + "inherits": "ArchToolsetStrategyBase" } ] } diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-result.txt b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-result.txt +++ b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-result.txt diff --git a/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-stderr.txt new file mode 100644 index 0000000..4a4d4ce --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy.json.in b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy.json.in new file mode 100644 index 0000000..9ec2cee --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidArchitectureStrategy.json.in @@ -0,0 +1,13 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "InvalidArchitectureStrategy", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "architecture": { + "strategy": {} + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-stderr.txt deleted file mode 100644 index 72a20d5..0000000 --- a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -^CMake Error: Could not read presets from [^ -]*/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-result.txt b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-result.txt index d00491f..d00491f 100644 --- a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-result.txt +++ b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-result.txt diff --git a/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-stderr.txt new file mode 100644 index 0000000..fab3766 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig.json.in b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy.json.in index 1479c66..7d2ab1f 100644 --- a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig.json.in +++ b/Tests/RunCMake/CMakePresets/InvalidToolsetStrategy.json.in @@ -2,10 +2,12 @@ "version": 1, "configurePresets": [ { - "name": "InvalidCMakeGeneratorConfig", + "name": "InvalidToolsetStrategy", "generator": "@RunCMake_GENERATOR@", "binaryDir": "${sourceDir}/build", - "cmakeGeneratorConfig": {} + "toolset": { + "strategy": {} + } } ] } diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake index dddf05f..bd84510 100644 --- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake @@ -117,8 +117,10 @@ run_cmake_presets(InvalidInheritance) run_cmake_presets(ErrorNoWarningDev) run_cmake_presets(ErrorNoWarningDeprecated) set(CMakePresets_SCHEMA_EXPECTED_RESULT 1) -run_cmake_presets(InvalidCMakeGeneratorConfig) -run_cmake_presets(UnknownCMakeGeneratorConfig) +run_cmake_presets(InvalidArchitectureStrategy) +run_cmake_presets(UnknownArchitectureStrategy) +run_cmake_presets(InvalidToolsetStrategy) +run_cmake_presets(UnknownToolsetStrategy) run_cmake_presets(EmptyCacheKey) run_cmake_presets(EmptyEnvKey) set(CMakePresets_SCHEMA_EXPECTED_RESULT 0) @@ -196,9 +198,9 @@ if(RunCMake_GENERATOR MATCHES "^Visual Studio ") run_cmake_presets(VisualStudioInheritanceMultiSecond) endif() else() - run_cmake_presets(CMakeGeneratorConfigNone) - run_cmake_presets(CMakeGeneratorConfigDefault) - run_cmake_presets(CMakeGeneratorConfigIgnore) + run_cmake_presets(ArchToolsetStrategyNone) + run_cmake_presets(ArchToolsetStrategyDefault) + run_cmake_presets(ArchToolsetStrategyIgnore) endif() # Test bad command line arguments diff --git a/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-result.txt b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-stderr.txt b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-stderr.txt new file mode 100644 index 0000000..cf17881 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy.json.in b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy.json.in new file mode 100644 index 0000000..a3bf7c8 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UnknownArchitectureStrategy.json.in @@ -0,0 +1,13 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "UnknownArchitectureStrategy", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "architecture": { + "strategy": "unknown" + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-stderr.txt b/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-stderr.txt deleted file mode 100644 index b1759b0..0000000 --- a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -^CMake Error: Could not read presets from [^ -]*/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-result.txt b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-stderr.txt b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-stderr.txt new file mode 100644 index 0000000..8f9be29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig.json.in b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy.json.in index 900c6df..1668700 100644 --- a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig.json.in +++ b/Tests/RunCMake/CMakePresets/UnknownToolsetStrategy.json.in @@ -2,10 +2,12 @@ "version": 1, "configurePresets": [ { - "name": "UnknownCMakeGeneratorConfig", + "name": "UnknownToolsetStrategy", "generator": "@RunCMake_GENERATOR@", "binaryDir": "${sourceDir}/build", - "cmakeGeneratorConfig": "unknown" + "toolset": { + "strategy": "unknown" + } } ] } |