diff options
Diffstat (limited to 'Tests/RunCMake/CMakePresets')
226 files changed, 1851 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-result.txt b/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-stderr.txt b/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-stderr.txt new file mode 100644 index 0000000..a3b79b6 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigDefault-stderr.txt @@ -0,0 +1,11 @@ +^CMake Error at CMakeLists\.txt:[0-9]+ \(project\): + Generator + + [^ +]* + + does not support platform specification, but platform + + a + + was specified\.$ diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigIgnore.cmake b/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigIgnore.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigIgnore.cmake diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-result.txt b/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-stderr.txt b/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-stderr.txt new file mode 100644 index 0000000..a3b79b6 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CMakeGeneratorConfigNone-stderr.txt @@ -0,0 +1,11 @@ +^CMake Error at CMakeLists\.txt:[0-9]+ \(project\): + Generator + + [^ +]* + + does not support platform specification, but platform + + a + + was specified\.$ diff --git a/Tests/RunCMake/CMakePresets/CMakeLists.txt.in b/Tests/RunCMake/CMakePresets/CMakeLists.txt.in new file mode 100644 index 0000000..67c2d48 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CMakeLists.txt.in @@ -0,0 +1,4 @@ +cmake_minimum_required(VERSION 3.18) +project(${RunCMake_TEST} NONE) +set(RunCMake_SOURCE_DIR [==[@RunCMake_SOURCE_DIR@]==]) +include("${RunCMake_SOURCE_DIR}/${RunCMake_TEST}.cmake") diff --git a/Tests/RunCMake/CMakePresets/CMakePresets.json.in b/Tests/RunCMake/CMakePresets/CMakePresets.json.in new file mode 100644 index 0000000..78e31c6 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CMakePresets.json.in @@ -0,0 +1,481 @@ +/* + * Block comment + */ +{ + // Inline comment + "version": 1, + "cmakeMinimumRequired": { + "major": 3, + "minor": 18, + "patch": 0 + }, + "vendor": { + "example.com/ExampleIDE/1.0": true + }, + "configurePresets": [ + { + "name": "Good", + "displayName": "Good Preset", + "description": "This preset is meant to test most of the fields when set correctly.", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cmakeExecutable": "/path/does/not/exist/cmake", + "vendor": { + "example.com/ExampleIDE/1.0": { + "transmogrify": true + } + }, + "cacheVariables": { + "TEST_SOURCE_DIR": { + "type": "PATH", + "value": "${sourceDir}" + }, + "TEST_SOURCE_PARENT_DIR": { + "type": "PATH", + "value": "${sourceParentDir}" + }, + "TEST_SOURCE_LIST": { + "type": "FILEPATH", + "value": "${sourceDir}/CMakeLists.txt" + }, + "TEST_TRUE": { + "type": "BOOL", + "value": "TRUE" + }, + "TEST_OFF": { + "type": "BOOL", + "value": "OFF" + }, + "TEST_PRESET_NAME": { + "type": "STRING", + "value": "x${presetName}x" + }, + "TEST_GENERATOR": { + "value": "x${generator}x" + }, + "TEST_DOLLAR": { + "value": "${dollar}" + }, + "TEST_ENV_REF": "$env{TEST_ENV_REF}", + "TEST_ENV": "$env{TEST_ENV}", + "TEST_D_ENV_REF": "$env{TEST_D_ENV_REF}", + "TEST_ENV_OVERRIDE": "$env{TEST_ENV_OVERRIDE}", + "TEST_PENV": "$env{TEST_PENV}", + "TEST_ENV_REF_PENV": "$env{TEST_ENV_REF_PENV}", + "TEST_ENV_REF_P": "$penv{TEST_ENV_REF}", + "TEST_ENV_P": "$penv{TEST_ENV}", + "TEST_D_ENV_REF_P": "$penv{TEST_D_ENV_REF}", + "TEST_ENV_OVERRIDE_P": "$penv{TEST_ENV_OVERRIDE}", + "TEST_PENV_P": "$penv{TEST_PENV}", + "TEST_ENV_REF_PENV_P": "$penv{TEST_ENV_REF_PENV}", + "TEST_MULTIPLE_MACROS": "${presetName} ${generator}", + "TEST_EXPANSION": "\\${presetName} ${dollar}{dollar} $unknown{namespace} $en{NOT_ENV} $enve{NOT_ENV} $ \\$ $a", + "TEST_TRAILING_DOLLAR": "a $", + "TEST_TRAILING_BACKSLASH": "a \\", + "TEST_TRAILING_UNKNOWN_NAMESPACE": "$unknown{namespace", + "TEST_OVERRIDE_1": { + "type": "STRING", + "value": "Default value" + }, + "TEST_OVERRIDE_2": "Default value", + "TEST_OVERRIDE_3": { + "type": "STRING", + "value": "Default value" + }, + "TEST_OVERRIDE_4": { + "type": "STRING", + "value": "Default value" + }, + "TEST_UNDEF": "undef" + }, + "environment": { + "TEST_ENV_REF": "$env{TEST_ENV}", + "TEST_ENV": "Environment variable", + "TEST_D_ENV_REF": "x$env{TEST_ENV_REF}x", + "TEST_ENV_OVERRIDE": "Overridden environment variable", + "TEST_ENV_REF_PENV": "prefix+$penv{TEST_ENV_REF_PENV}", + "TEST_PENV": null + } + }, + { + "name": "GoodNoArgs", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "GoodBinaryUp", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/../GoodBinaryUp-build" + }, + { + "name": "GoodBinaryRelative", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "build" + }, + { + "name": "Good Spaces", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "GoodWindowsBackslash", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}\\build" + }, + { + "name": "GoodBinaryCmdLine", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "GoodGeneratorCmdLine", + "generator": "Invalid Generator", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "InvalidGeneratorCmdLine", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "GoodNoS", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "GoodInheritanceParentBase", + "hidden": true, + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "TEST_VARIABLE": { + "type": "STRING", + "value": "Some string" + } + }, + "environment": { + "TEST_ENV": "Some environment variable" + } + }, + { + "name": "GoodInheritanceParent", + "inherits": "GoodInheritanceParentBase" + }, + { + "name": "GoodInheritanceChildBase", + "hidden": true + }, + { + "name": "GoodInheritanceChild", + "inherits": "GoodInheritanceChildBase", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "TEST_VARIABLE": { + "type": "STRING", + "value": "Some string" + } + }, + "environment": { + "TEST_ENV": "Some environment variable" + } + }, + { + "name": "GoodInheritanceOverrideBase", + "hidden": true, + "generator": "Invalid Generator", + "binaryDir": "${sourceDir}/../GoodInheritanceBase-build", + "cacheVariables": { + "PARENT_VARIABLE": { + "type": "STRING", + "value": "Parent variable" + }, + "OVERRIDDEN_VARIABLE": { + "type": "BOOL", + "value": "ON" + }, + "DELETED_VARIABLE": "This variable will be deleted" + }, + "environment": { + "PARENT_ENV": "Parent environment variable", + "OVERRIDDEN_ENV": "This environment variable will be overridden", + "DELETED_ENV": "This environment variable will be deleted" + } + }, + { + "name": "GoodInheritanceOverride", + "inherits": "GoodInheritanceOverrideBase", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "OVERRIDDEN_VARIABLE": { + "type": "STRING", + "value": "Overridden variable" + }, + "CHILD_VARIABLE": { + "type": "STRING", + "value": "Child variable" + }, + "DELETED_VARIABLE": null + }, + "environment": { + "OVERRIDDEN_ENV": "Overridden environment variable", + "CHILD_ENV": "Child environment variable", + "DELETED_ENV": null + } + }, + { + "name": "GoodInheritanceOverrideDummy", + "inherits": "GoodInheritanceOverride" + }, + { + "name": "GoodInheritanceMulti1", + "hidden": true, + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "FIRST_VARIABLE": { + "type": "STRING", + "value": "First variable" + }, + "OVERRIDDEN_VARIABLE": { + "type": "STRING", + "value": "Overridden variable" + } + }, + "environment": { + "FIRST_ENV": "First environment variable", + "OVERRIDDEN_ENV": "Overridden environment variable" + } + }, + { + "name": "GoodInheritanceMulti2", + "hidden": true, + "generator": "Invalid Generator", + "binaryDir": "${sourceDir}/../GoodInheritanceMulti2-build", + "cacheVariables": { + "SECOND_VARIABLE": { + "type": "STRING", + "value": "Second variable" + }, + "OVERRIDDEN_VARIABLE": { + "type": "BOOL", + "value": "ON" + } + }, + "environment": { + "SECOND_ENV": "Second environment variable", + "OVERRIDDEN_ENV": "This will be overridden" + } + }, + { + "name": "GoodInheritanceMulti", + "inherits": [ + "GoodInheritanceMulti1", + "GoodInheritanceMulti2" + ] + }, + { + "name": "GoodInheritanceMultiSecond1", + "hidden": true + }, + { + "name": "GoodInheritanceMultiSecond2", + "hidden": true, + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "GoodInheritanceMultiSecond", + "inherits": [ + "GoodInheritanceMultiSecond1", + "GoodInheritanceMultiSecond2" + ] + }, + { + "name": "GoodInheritanceMacroBase", + "hidden": true, + "cacheVariables": { + "PRESET_NAME": "${presetName}" + } + }, + { + "name": "GoodInheritanceMacro", + "inherits": "GoodInheritanceMacroBase", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "UnclosedMacro", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir" + }, + { + "name": "NoSuchMacro", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${noexist}" + }, + { + "name": "VendorMacro", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "$vendor{unknown.unknownMacro}" + }, + { + "name": "InvalidGenerator", + "generator": "Invalid Generator", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "EnvCycle", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "environment": { + "ENV_1": "$env{ENV_2}", + "ENV_2": "$env{ENV_1}" + } + }, + { + "name": "UseHiddenPreset", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "hidden": true + }, + { + "name": "VisualStudioGeneratorArch", + "generator": "@RunCMake_GENERATOR@ Win64", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "VisualStudioWin32", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "architecture": "Win32" + }, + { + "name": "VisualStudioWin64", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "architecture": "x64" + }, + { + "name": "VisualStudioWin32Override", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "architecture": "Win32" + }, + { + "name": "VisualStudioToolset", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "toolset": "Test Toolset" + }, + { + "name": "VisualStudioToolsetOverride", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "toolset": "Invalid Toolset" + }, + { + "name": "VisualStudioInheritanceParentBase", + "hidden": true, + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "architecture": "Test Platform", + "toolset": "Test Toolset" + }, + { + "name": "VisualStudioInheritanceParent", + "inherits": "VisualStudioInheritanceParentBase" + }, + { + "name": "VisualStudioInheritanceChildBase", + "hidden": true + }, + { + "name": "VisualStudioInheritanceChild", + "inherits": "VisualStudioInheritanceChildBase", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "architecture": "Test Platform", + "toolset": "Test Toolset" + }, + { + "name": "VisualStudioInheritanceOverrideBase", + "hidden": true, + "architecture": "Invalid Platform", + "toolset": "Invalid Toolset" + }, + { + "name": "VisualStudioInheritanceOverride", + "inherits": "VisualStudioInheritanceOverrideBase", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "architecture": "Test Platform", + "toolset": "Test Toolset" + }, + { + "name": "VisualStudioInheritanceMulti1", + "hidden": true, + "architecture": "Test Platform", + "toolset": "Test Toolset" + }, + { + "name": "VisualStudioInheritanceMulti2", + "hidden": true, + "architecture": "Invalid Platform", + "toolset": "Invalid Toolset" + }, + { + "name": "VisualStudioInheritanceMulti", + "inherits": [ + "VisualStudioInheritanceMulti1", + "VisualStudioInheritanceMulti2" + ], + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "VisualStudioInheritanceMultiSecond1", + "hidden": true + }, + { + "name": "VisualStudioInheritanceMultiSecond2", + "hidden": true, + "architecture": "Test Platform", + "toolset": "Test Toolset" + }, + { + "name": "VisualStudioInheritanceMultiSecond", + "inherits": [ + "VisualStudioInheritanceMultiSecond1", + "VisualStudioInheritanceMultiSecond2" + ], + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "CMakeGeneratorConfigNone", + "generator": "@RunCMake_GENERATOR@", + "architecture": "a", + "toolset": "a", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "CMakeGeneratorConfigBase", + "generator": "@RunCMake_GENERATOR@", + "architecture": "a", + "toolset": "a", + "cmakeGeneratorConfig": "ignore", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "CMakeGeneratorConfigDefault", + "inherits": "CMakeGeneratorConfigBase", + "cmakeGeneratorConfig": "default" + }, + { + "name": "CMakeGeneratorConfigIgnore", + "inherits": "CMakeGeneratorConfigBase" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/CacheOverride.cmake b/Tests/RunCMake/CMakePresets/CacheOverride.cmake new file mode 100644 index 0000000..d0ebe17 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CacheOverride.cmake @@ -0,0 +1,2 @@ +set(TEST_OVERRIDE_3 "Overridden value" CACHE STRING "") +set(TEST_OVERRIDE_4 "Overridden value" CACHE INTERNAL "") diff --git a/Tests/RunCMake/CMakePresets/CyclicInheritance0-result.txt b/Tests/RunCMake/CMakePresets/CyclicInheritance0-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CyclicInheritance0-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/CyclicInheritance0-stderr.txt b/Tests/RunCMake/CMakePresets/CyclicInheritance0-stderr.txt new file mode 100644 index 0000000..895afcb --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CyclicInheritance0-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/CyclicInheritance0: Cyclic preset inheritance$ diff --git a/Tests/RunCMake/CMakePresets/CyclicInheritance0.json.in b/Tests/RunCMake/CMakePresets/CyclicInheritance0.json.in new file mode 100644 index 0000000..3468936 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CyclicInheritance0.json.in @@ -0,0 +1,13 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "CyclicInheritance0", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "inherits": [ + "CyclicInheritance0" + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/CyclicInheritance1-result.txt b/Tests/RunCMake/CMakePresets/CyclicInheritance1-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CyclicInheritance1-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/CyclicInheritance1-stderr.txt b/Tests/RunCMake/CMakePresets/CyclicInheritance1-stderr.txt new file mode 100644 index 0000000..1e59e92 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CyclicInheritance1-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/CyclicInheritance1: Cyclic preset inheritance$ diff --git a/Tests/RunCMake/CMakePresets/CyclicInheritance1.json.in b/Tests/RunCMake/CMakePresets/CyclicInheritance1.json.in new file mode 100644 index 0000000..fabd4af --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CyclicInheritance1.json.in @@ -0,0 +1,21 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "CyclicInheritance0", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "inherits": [ + "CyclicInheritance1" + ] + }, + { + "name": "CyclicInheritance1", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "inherits": [ + "CyclicInheritance0" + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/CyclicInheritance2-result.txt b/Tests/RunCMake/CMakePresets/CyclicInheritance2-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CyclicInheritance2-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/CyclicInheritance2-stderr.txt b/Tests/RunCMake/CMakePresets/CyclicInheritance2-stderr.txt new file mode 100644 index 0000000..56e630b --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CyclicInheritance2-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/CyclicInheritance2: Cyclic preset inheritance$ diff --git a/Tests/RunCMake/CMakePresets/CyclicInheritance2.json.in b/Tests/RunCMake/CMakePresets/CyclicInheritance2.json.in new file mode 100644 index 0000000..0e1d7d4 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/CyclicInheritance2.json.in @@ -0,0 +1,29 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "CyclicInheritance0", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "inherits": [ + "CyclicInheritance1" + ] + }, + { + "name": "CyclicInheritance1", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "inherits": [ + "CyclicInheritance2" + ] + }, + { + "name": "CyclicInheritance2", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "inherits": [ + "CyclicInheritance0" + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/Debug-stderr.txt b/Tests/RunCMake/CMakePresets/Debug-stderr.txt new file mode 100644 index 0000000..7fdb8b3 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Debug-stderr.txt @@ -0,0 +1 @@ + find_package considered the following locations for the Config module: diff --git a/Tests/RunCMake/CMakePresets/Debug-stdout.txt b/Tests/RunCMake/CMakePresets/Debug-stdout.txt new file mode 100644 index 0000000..7d1f388 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Debug-stdout.txt @@ -0,0 +1,4 @@ +-- Generating [^ +]*/Tests/RunCMake/CMakePresets/Debug/build + Called from: \[1\][^ +]*/Tests/RunCMake/CMakePresets/Debug/CMakeLists\.txt diff --git a/Tests/RunCMake/CMakePresets/Debug.cmake b/Tests/RunCMake/CMakePresets/Debug.cmake new file mode 100644 index 0000000..19c7db2 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Debug.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_LIST_DIR}/DebugBase.cmake) +if(NOT EXISTS "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CMakeLists.txt") + message(SEND_ERROR "Debugging try_compile() did not work") +endif() diff --git a/Tests/RunCMake/CMakePresets/Debug.json.in b/Tests/RunCMake/CMakePresets/Debug.json.in new file mode 100644 index 0000000..500700e --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Debug.json.in @@ -0,0 +1,19 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "NoDebug", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "Debug", + "inherits": "NoDebug", + "debug": { + "output": true, + "find": true, + "tryCompile": true + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/DebugBase.cmake b/Tests/RunCMake/CMakePresets/DebugBase.cmake new file mode 100644 index 0000000..870f31c --- /dev/null +++ b/Tests/RunCMake/CMakePresets/DebugBase.cmake @@ -0,0 +1,3 @@ +enable_language(C) +try_compile(_result ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_LIST_DIR}/main.c) +find_package(ThisPackageHopefullyDoesNotExist CONFIG) diff --git a/Tests/RunCMake/CMakePresets/DisableWarningFlags.cmake b/Tests/RunCMake/CMakePresets/DisableWarningFlags.cmake new file mode 100644 index 0000000..5de7687 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/DisableWarningFlags.cmake @@ -0,0 +1 @@ +include(${CMAKE_CURRENT_LIST_DIR}/WarningsBase.cmake) diff --git a/Tests/RunCMake/CMakePresets/DuplicatePresets-result.txt b/Tests/RunCMake/CMakePresets/DuplicatePresets-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/DuplicatePresets-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/DuplicatePresets-stderr.txt b/Tests/RunCMake/CMakePresets/DuplicatePresets-stderr.txt new file mode 100644 index 0000000..c9361ae --- /dev/null +++ b/Tests/RunCMake/CMakePresets/DuplicatePresets-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/DuplicatePresets: Duplicate presets$ diff --git a/Tests/RunCMake/CMakePresets/DuplicatePresets.json.in b/Tests/RunCMake/CMakePresets/DuplicatePresets.json.in new file mode 100644 index 0000000..cf388e7 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/DuplicatePresets.json.in @@ -0,0 +1,15 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "DuplicatePresets", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "DuplicatePresets", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/EmptyPresetName-result.txt b/Tests/RunCMake/CMakePresets/EmptyPresetName-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/EmptyPresetName-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/EmptyPresetName-stderr.txt b/Tests/RunCMake/CMakePresets/EmptyPresetName-stderr.txt new file mode 100644 index 0000000..6970674 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/EmptyPresetName-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/EmptyPresetName: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/EmptyPresetName.json.in b/Tests/RunCMake/CMakePresets/EmptyPresetName.json.in new file mode 100644 index 0000000..fd4bedd --- /dev/null +++ b/Tests/RunCMake/CMakePresets/EmptyPresetName.json.in @@ -0,0 +1,10 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/EnvCycle-result.txt b/Tests/RunCMake/CMakePresets/EnvCycle-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/EnvCycle-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/EnvCycle-stderr.txt b/Tests/RunCMake/CMakePresets/EnvCycle-stderr.txt new file mode 100644 index 0000000..c8568f1 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/EnvCycle-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Could not evaluate preset "EnvCycle": Invalid macro expansion$ diff --git a/Tests/RunCMake/CMakePresets/ErrorDeprecated-result.txt b/Tests/RunCMake/CMakePresets/ErrorDeprecated-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ErrorDeprecated-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/ErrorDeprecated-stderr.txt b/Tests/RunCMake/CMakePresets/ErrorDeprecated-stderr.txt new file mode 100644 index 0000000..964a504 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ErrorDeprecated-stderr.txt @@ -0,0 +1,7 @@ +^CMake Deprecation Error at [^ +]*/Tests/RunCMake/CMakePresets/WarningsBase\.cmake:[0-9]+ \(message\): + Deprecation warning +Call Stack \(most recent call first\): + [^ +]*/Tests/RunCMake/CMakePresets/ErrorDeprecated\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\)$ diff --git a/Tests/RunCMake/CMakePresets/ErrorDeprecated.cmake b/Tests/RunCMake/CMakePresets/ErrorDeprecated.cmake new file mode 100644 index 0000000..5de7687 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ErrorDeprecated.cmake @@ -0,0 +1 @@ +include(${CMAKE_CURRENT_LIST_DIR}/WarningsBase.cmake) diff --git a/Tests/RunCMake/CMakePresets/ErrorDev-result.txt b/Tests/RunCMake/CMakePresets/ErrorDev-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ErrorDev-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/ErrorDev-stderr.txt b/Tests/RunCMake/CMakePresets/ErrorDev-stderr.txt new file mode 100644 index 0000000..f76478c --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ErrorDev-stderr.txt @@ -0,0 +1,8 @@ +^CMake Error \(dev\) at [^ +]*/Tests/RunCMake/CMakePresets/WarningsBase\.cmake:[0-9]+ \(message\): + Dev warning +Call Stack \(most recent call first\): + [^ +]*/Tests/RunCMake/CMakePresets/ErrorDev\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\) +This error is for project developers\. Use -Wno-error=dev to suppress it\.$ diff --git a/Tests/RunCMake/CMakePresets/ErrorDev.cmake b/Tests/RunCMake/CMakePresets/ErrorDev.cmake new file mode 100644 index 0000000..5de7687 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ErrorDev.cmake @@ -0,0 +1 @@ +include(${CMAKE_CURRENT_LIST_DIR}/WarningsBase.cmake) diff --git a/Tests/RunCMake/CMakePresets/ErrorNoWarningDeprecated-result.txt b/Tests/RunCMake/CMakePresets/ErrorNoWarningDeprecated-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ErrorNoWarningDeprecated-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/ErrorNoWarningDeprecated-stderr.txt b/Tests/RunCMake/CMakePresets/ErrorNoWarningDeprecated-stderr.txt new file mode 100644 index 0000000..3221345 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ErrorNoWarningDeprecated-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/ErrorNoWarningDeprecated: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/ErrorNoWarningDeprecated.json.in b/Tests/RunCMake/CMakePresets/ErrorNoWarningDeprecated.json.in new file mode 100644 index 0000000..664b3ee --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ErrorNoWarningDeprecated.json.in @@ -0,0 +1,16 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "ErrorNoWarningDeprecated", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "warnings": { + "deprecated": false + }, + "errors": { + "deprecated": true + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/ErrorNoWarningDev-result.txt b/Tests/RunCMake/CMakePresets/ErrorNoWarningDev-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ErrorNoWarningDev-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/ErrorNoWarningDev-stderr.txt b/Tests/RunCMake/CMakePresets/ErrorNoWarningDev-stderr.txt new file mode 100644 index 0000000..d2ddb90 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ErrorNoWarningDev-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/ErrorNoWarningDev: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/ErrorNoWarningDev.json.in b/Tests/RunCMake/CMakePresets/ErrorNoWarningDev.json.in new file mode 100644 index 0000000..d681b2a --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ErrorNoWarningDev.json.in @@ -0,0 +1,16 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "ErrorNoWarningDev", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "warnings": { + "dev": false + }, + "errors": { + "dev": true + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/ExtraPresetField-result.txt b/Tests/RunCMake/CMakePresets/ExtraPresetField-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ExtraPresetField-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/ExtraPresetField-stderr.txt b/Tests/RunCMake/CMakePresets/ExtraPresetField-stderr.txt new file mode 100644 index 0000000..559e3c2 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ExtraPresetField-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/ExtraPresetField: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/ExtraPresetField.json.in b/Tests/RunCMake/CMakePresets/ExtraPresetField.json.in new file mode 100644 index 0000000..b529758 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ExtraPresetField.json.in @@ -0,0 +1,11 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "ExtraPresetField", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "invalid": true + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/ExtraRootField-result.txt b/Tests/RunCMake/CMakePresets/ExtraRootField-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ExtraRootField-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/ExtraRootField-stderr.txt b/Tests/RunCMake/CMakePresets/ExtraRootField-stderr.txt new file mode 100644 index 0000000..bb281be --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ExtraRootField-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/ExtraRootField: Invalid root object$ diff --git a/Tests/RunCMake/CMakePresets/ExtraRootField.json.in b/Tests/RunCMake/CMakePresets/ExtraRootField.json.in new file mode 100644 index 0000000..bcfa68b --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ExtraRootField.json.in @@ -0,0 +1,11 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "ExtraRootField", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ], + "invalid": true +} diff --git a/Tests/RunCMake/CMakePresets/ExtraVariableField-result.txt b/Tests/RunCMake/CMakePresets/ExtraVariableField-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ExtraVariableField-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/ExtraVariableField-stderr.txt b/Tests/RunCMake/CMakePresets/ExtraVariableField-stderr.txt new file mode 100644 index 0000000..9b346e7 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ExtraVariableField-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/ExtraVariableField: Invalid CMake variable definition$ diff --git a/Tests/RunCMake/CMakePresets/ExtraVariableField.json.in b/Tests/RunCMake/CMakePresets/ExtraVariableField.json.in new file mode 100644 index 0000000..a810560 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ExtraVariableField.json.in @@ -0,0 +1,16 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "ExtraVariableField", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "EXTRA": { + "value": "", + "invalid": true + } + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/Good-stdout.txt b/Tests/RunCMake/CMakePresets/Good-stdout.txt new file mode 100644 index 0000000..ce6189e --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Good-stdout.txt @@ -0,0 +1,46 @@ +Preset CMake variables: + + TEST_DOLLAR="\$" + TEST_D_ENV_REF="xEnvironment variablex" + TEST_D_ENV_REF_P="" + TEST_ENV="Environment variable" + TEST_ENV_OVERRIDE="Overridden environment variable" + TEST_ENV_OVERRIDE_P="This environment variable will be overridden" + TEST_ENV_P="" + TEST_ENV_REF="Environment variable" + TEST_ENV_REF_P="" + TEST_ENV_REF_PENV="prefix\+suffix" + TEST_ENV_REF_PENV_P="suffix" + TEST_EXPANSION="\\Good \${dollar} \$unknown{namespace} \$en{NOT_ENV} \$enve{NOT_ENV} \$ \\\$ \$a" + TEST_GENERATOR="x[^ +]*x" + TEST_MULTIPLE_MACROS="Good [^ +]*" + TEST_OFF:BOOL="OFF" + TEST_OVERRIDE_3:STRING="Default value" + TEST_OVERRIDE_4:STRING="Default value" + TEST_PENV="Process environment variable" + TEST_PENV_P="Process environment variable" + TEST_PRESET_NAME:STRING="xGoodx" + TEST_SOURCE_DIR:PATH="[^ +]*/Tests/RunCMake/CMakePresets/Good" + TEST_SOURCE_LIST:FILEPATH="[^ +]*/Tests/RunCMake/CMakePresets/Good/CMakeLists\.txt" + TEST_SOURCE_PARENT_DIR:PATH="[^ +]*/Tests/RunCMake/CMakePresets" + TEST_TRAILING_BACKSLASH="a \\" + TEST_TRAILING_DOLLAR="a \$" + TEST_TRAILING_UNKNOWN_NAMESPACE="\$unknown{namespace" + TEST_TRUE:BOOL="TRUE" + +Preset environment variables: + + TEST_D_ENV_REF="xEnvironment variablex" + TEST_ENV="Environment variable" + TEST_ENV_OVERRIDE="Overridden environment variable" + TEST_ENV_REF="Environment variable" + TEST_ENV_REF_PENV="prefix\+suffix" + +(-- Selecting Windows SDK version [^ +]* +)?-- Configuring done diff --git a/Tests/RunCMake/CMakePresets/Good.cmake b/Tests/RunCMake/CMakePresets/Good.cmake new file mode 100644 index 0000000..d8e3e2d --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Good.cmake @@ -0,0 +1,45 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +get_filename_component(_parent_dir "${CMAKE_SOURCE_DIR}" DIRECTORY) +test_variable(CMAKE_BINARY_DIR "" "${CMAKE_SOURCE_DIR}/build") +test_variable(CMAKE_GENERATOR "" "${RunCMake_GENERATOR}") +test_variable(TEST_SOURCE_DIR "PATH" "${CMAKE_SOURCE_DIR}") +test_variable(TEST_SOURCE_PARENT_DIR "PATH" "${_parent_dir}") +test_variable(TEST_SOURCE_LIST "FILEPATH" "${CMAKE_SOURCE_DIR}/CMakeLists.txt") +test_variable(TEST_TRUE "BOOL" "TRUE") +test_variable(TEST_OFF "BOOL" "OFF") +test_variable(TEST_PRESET_NAME "STRING" "xGoodx") +test_variable(TEST_GENERATOR "UNINITIALIZED" "x${CMAKE_GENERATOR}x") +test_variable(TEST_DOLLAR "UNINITIALIZED" "$") +test_variable(TEST_ENV_REF "UNINITIALIZED" "Environment variable") +test_variable(TEST_ENV "UNINITIALIZED" "Environment variable") +test_variable(TEST_D_ENV_REF "UNINITIALIZED" "xEnvironment variablex") +test_variable(TEST_ENV_OVERRIDE "UNINITIALIZED" "Overridden environment variable") +test_variable(TEST_PENV "UNINITIALIZED" "Process environment variable") +test_variable(TEST_ENV_REF_PENV "UNINITIALIZED" "prefix+suffix") +test_variable(TEST_ENV_REF_P "UNINITIALIZED" "") +test_variable(TEST_ENV_P "UNINITIALIZED" "") +test_variable(TEST_D_ENV_REF_P "UNINITIALIZED" "") +test_variable(TEST_ENV_OVERRIDE_P "UNINITIALIZED" "This environment variable will be overridden") +test_variable(TEST_PENV_P "UNINITIALIZED" "Process environment variable") +test_variable(TEST_ENV_REF_PENV_P "UNINITIALIZED" "suffix") +test_variable(TEST_MULTIPLE_MACROS "UNINITIALIZED" "Good ${CMAKE_GENERATOR}") +test_variable(TEST_EXPANSION "UNINITIALIZED" "\\Good \${dollar} \$unknown{namespace} \$en{NOT_ENV} \$enve{NOT_ENV} $ \\$ $a") +test_variable(TEST_TRAILING_DOLLAR "UNINITIALIZED" "a $") +test_variable(TEST_TRAILING_BACKSLASH "UNINITIALIZED" "a \\") +test_variable(TEST_TRAILING_UNKNOWN_NAMESPACE "UNINITIALIZED" "\$unknown{namespace") +test_variable(TEST_OVERRIDE_1 "UNINITIALIZED" "Overridden value") +test_variable(TEST_OVERRIDE_2 "STRING" "Overridden value") +test_variable(TEST_OVERRIDE_3 "STRING" "Default value") +test_variable(TEST_OVERRIDE_4 "INTERNAL" "Overridden value") + +if(DEFINED TEST_UNDEF OR DEFINED CACHE{TEST_UNDEF}) + message(SEND_ERROR "TEST_UNDEF should not be defined") +endif() + +test_environment_variable(TEST_ENV_REF "Environment variable") +test_environment_variable(TEST_ENV "Environment variable") +test_environment_variable(TEST_D_ENV_REF "xEnvironment variablex") +test_environment_variable(TEST_ENV_OVERRIDE "Overridden environment variable") +test_environment_variable(TEST_PENV "Process environment variable") +test_environment_variable(TEST_ENV_REF_PENV "prefix+suffix") diff --git a/Tests/RunCMake/CMakePresets/GoodBOM.cmake b/Tests/RunCMake/CMakePresets/GoodBOM.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodBOM.cmake diff --git a/Tests/RunCMake/CMakePresets/GoodBOM.json.in b/Tests/RunCMake/CMakePresets/GoodBOM.json.in new file mode 100644 index 0000000..2152511 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodBOM.json.in @@ -0,0 +1,10 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "GoodBOM", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/GoodBinaryCmdLine.cmake b/Tests/RunCMake/CMakePresets/GoodBinaryCmdLine.cmake new file mode 100644 index 0000000..9f928fe --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodBinaryCmdLine.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +get_filename_component(_parent "${CMAKE_SOURCE_DIR}" DIRECTORY) +test_variable(CMAKE_BINARY_DIR "" "${_parent}/GoodBinaryCmdLine-build") diff --git a/Tests/RunCMake/CMakePresets/GoodBinaryRelative.cmake b/Tests/RunCMake/CMakePresets/GoodBinaryRelative.cmake new file mode 100644 index 0000000..49e7a25 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodBinaryRelative.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_BINARY_DIR "" "${CMAKE_SOURCE_DIR}/build") diff --git a/Tests/RunCMake/CMakePresets/GoodBinaryUp.cmake b/Tests/RunCMake/CMakePresets/GoodBinaryUp.cmake new file mode 100644 index 0000000..f7fb224 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodBinaryUp.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +get_filename_component(_parent "${CMAKE_SOURCE_DIR}" DIRECTORY) +test_variable(CMAKE_BINARY_DIR "" "${_parent}/GoodBinaryUp-build") diff --git a/Tests/RunCMake/CMakePresets/GoodGeneratorCmdLine.cmake b/Tests/RunCMake/CMakePresets/GoodGeneratorCmdLine.cmake new file mode 100644 index 0000000..4319e72 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodGeneratorCmdLine.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_GENERATOR "" "${RunCMake_GENERATOR}") diff --git a/Tests/RunCMake/CMakePresets/GoodInheritanceChild.cmake b/Tests/RunCMake/CMakePresets/GoodInheritanceChild.cmake new file mode 100644 index 0000000..cfc93be --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodInheritanceChild.cmake @@ -0,0 +1,6 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_BINARY_DIR "" "${CMAKE_SOURCE_DIR}/build") +test_variable(TEST_VARIABLE "STRING" "Some string") + +test_environment_variable(TEST_ENV "Some environment variable") diff --git a/Tests/RunCMake/CMakePresets/GoodInheritanceMacro.cmake b/Tests/RunCMake/CMakePresets/GoodInheritanceMacro.cmake new file mode 100644 index 0000000..96fede0 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodInheritanceMacro.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(PRESET_NAME "UNINITIALIZED" "GoodInheritanceMacro") diff --git a/Tests/RunCMake/CMakePresets/GoodInheritanceMulti.cmake b/Tests/RunCMake/CMakePresets/GoodInheritanceMulti.cmake new file mode 100644 index 0000000..6430f4d --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodInheritanceMulti.cmake @@ -0,0 +1,10 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_BINARY_DIR "" "${CMAKE_SOURCE_DIR}/build") +test_variable(FIRST_VARIABLE "STRING" "First variable") +test_variable(SECOND_VARIABLE "STRING" "Second variable") +test_variable(OVERRIDDEN_VARIABLE "STRING" "Overridden variable") + +test_environment_variable(FIRST_ENV "First environment variable") +test_environment_variable(SECOND_ENV "Second environment variable") +test_environment_variable(OVERRIDDEN_ENV "Overridden environment variable") diff --git a/Tests/RunCMake/CMakePresets/GoodInheritanceMultiSecond.cmake b/Tests/RunCMake/CMakePresets/GoodInheritanceMultiSecond.cmake new file mode 100644 index 0000000..49e7a25 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodInheritanceMultiSecond.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_BINARY_DIR "" "${CMAKE_SOURCE_DIR}/build") diff --git a/Tests/RunCMake/CMakePresets/GoodInheritanceOverride.cmake b/Tests/RunCMake/CMakePresets/GoodInheritanceOverride.cmake new file mode 100644 index 0000000..5231803 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodInheritanceOverride.cmake @@ -0,0 +1,18 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_BINARY_DIR "" "${CMAKE_SOURCE_DIR}/build") +test_variable(PARENT_VARIABLE "STRING" "Parent variable") +test_variable(OVERRIDDEN_VARIABLE "STRING" "Overridden variable") +test_variable(CHILD_VARIABLE "STRING" "Child variable") + +if(DEFINED DELETED_VARIABLE OR DEFINED CACHE{DELETED_VARIABLE}) + message(SEND_ERROR "DELETED_VARIABLE should not be defined") +endif() + +test_environment_variable(PARENT_ENV "Parent environment variable") +test_environment_variable(CHILD_ENV "Child environment variable") +test_environment_variable(OVERRIDDEN_ENV "Overridden environment variable") + +if(DEFINED ENV{DELETED_ENV}) + message(SEND_ERROR "DELETED_ENV should not be defined") +endif() diff --git a/Tests/RunCMake/CMakePresets/GoodInheritanceParent.cmake b/Tests/RunCMake/CMakePresets/GoodInheritanceParent.cmake new file mode 100644 index 0000000..cfc93be --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodInheritanceParent.cmake @@ -0,0 +1,6 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_BINARY_DIR "" "${CMAKE_SOURCE_DIR}/build") +test_variable(TEST_VARIABLE "STRING" "Some string") + +test_environment_variable(TEST_ENV "Some environment variable") diff --git a/Tests/RunCMake/CMakePresets/GoodNoArgs.cmake b/Tests/RunCMake/CMakePresets/GoodNoArgs.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodNoArgs.cmake diff --git a/Tests/RunCMake/CMakePresets/GoodNoS.cmake b/Tests/RunCMake/CMakePresets/GoodNoS.cmake new file mode 100644 index 0000000..1d3b2ff --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodNoS.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +get_filename_component(_parent "${CMAKE_SOURCE_DIR}" DIRECTORY) +test_variable(CMAKE_BINARY_DIR "" "${_parent}/GoodNoS-build") diff --git a/Tests/RunCMake/CMakePresets/GoodSpaces.cmake b/Tests/RunCMake/CMakePresets/GoodSpaces.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodSpaces.cmake diff --git a/Tests/RunCMake/CMakePresets/GoodUserFromMain.cmake b/Tests/RunCMake/CMakePresets/GoodUserFromMain.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodUserFromMain.cmake diff --git a/Tests/RunCMake/CMakePresets/GoodUserFromMain.json.in b/Tests/RunCMake/CMakePresets/GoodUserFromMain.json.in new file mode 100644 index 0000000..348443e --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodUserFromMain.json.in @@ -0,0 +1,10 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "GoodUserFromMain", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/GoodUserFromMainUser.json.in b/Tests/RunCMake/CMakePresets/GoodUserFromMainUser.json.in new file mode 100644 index 0000000..77b4ef6 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodUserFromMainUser.json.in @@ -0,0 +1,4 @@ +{ + "version": 1, + "configurePresets": [] +} diff --git a/Tests/RunCMake/CMakePresets/GoodUserFromUser.cmake b/Tests/RunCMake/CMakePresets/GoodUserFromUser.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodUserFromUser.cmake diff --git a/Tests/RunCMake/CMakePresets/GoodUserFromUser.json.in b/Tests/RunCMake/CMakePresets/GoodUserFromUser.json.in new file mode 100644 index 0000000..77b4ef6 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodUserFromUser.json.in @@ -0,0 +1,4 @@ +{ + "version": 1, + "configurePresets": [] +} diff --git a/Tests/RunCMake/CMakePresets/GoodUserFromUserUser.json.in b/Tests/RunCMake/CMakePresets/GoodUserFromUserUser.json.in new file mode 100644 index 0000000..83196be --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodUserFromUserUser.json.in @@ -0,0 +1,10 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "GoodUserFromUser", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/GoodUserOnly.cmake b/Tests/RunCMake/CMakePresets/GoodUserOnly.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodUserOnly.cmake diff --git a/Tests/RunCMake/CMakePresets/GoodUserOnlyUser.json.in b/Tests/RunCMake/CMakePresets/GoodUserOnlyUser.json.in new file mode 100644 index 0000000..274f4c7 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodUserOnlyUser.json.in @@ -0,0 +1,10 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "GoodUserOnly", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/GoodWindowsBackslash.cmake b/Tests/RunCMake/CMakePresets/GoodWindowsBackslash.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/GoodWindowsBackslash.cmake diff --git a/Tests/RunCMake/CMakePresets/HighVersion-result.txt b/Tests/RunCMake/CMakePresets/HighVersion-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/HighVersion-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/HighVersion-stderr.txt b/Tests/RunCMake/CMakePresets/HighVersion-stderr.txt new file mode 100644 index 0000000..d8622f2 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/HighVersion-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/HighVersion: Unrecognized "version" field$ diff --git a/Tests/RunCMake/CMakePresets/HighVersion.json.in b/Tests/RunCMake/CMakePresets/HighVersion.json.in new file mode 100644 index 0000000..8107842 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/HighVersion.json.in @@ -0,0 +1,4 @@ +{ + "version": 1000, + "configurePresets": [] +} diff --git a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-result.txt b/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-stderr.txt new file mode 100644 index 0000000..72a20d5 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig.json.in b/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig.json.in new file mode 100644 index 0000000..1479c66 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidCMakeGeneratorConfig.json.in @@ -0,0 +1,11 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "InvalidCMakeGeneratorConfig", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cmakeGeneratorConfig": {} + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/InvalidGenerator-result.txt b/Tests/RunCMake/CMakePresets/InvalidGenerator-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidGenerator-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidGenerator-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidGenerator-stderr.txt new file mode 100644 index 0000000..c7dd19b --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidGenerator-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: Could not create named generator Invalid Generator + +Generators diff --git a/Tests/RunCMake/CMakePresets/InvalidGeneratorCmdLine-result.txt b/Tests/RunCMake/CMakePresets/InvalidGeneratorCmdLine-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidGeneratorCmdLine-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidGeneratorCmdLine-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidGeneratorCmdLine-stderr.txt new file mode 100644 index 0000000..c7dd19b --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidGeneratorCmdLine-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: Could not create named generator Invalid Generator + +Generators diff --git a/Tests/RunCMake/CMakePresets/InvalidInheritance-result.txt b/Tests/RunCMake/CMakePresets/InvalidInheritance-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidInheritance-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidInheritance-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidInheritance-stderr.txt new file mode 100644 index 0000000..97f3876 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidInheritance-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidInheritance: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/InvalidInheritance.json.in b/Tests/RunCMake/CMakePresets/InvalidInheritance.json.in new file mode 100644 index 0000000..77bd9a3 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidInheritance.json.in @@ -0,0 +1,13 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "InvalidInheritance", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "inherits": [ + "NoExist" + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir-result.txt b/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir-stderr.txt new file mode 100644 index 0000000..2fe8c66 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir.json.in b/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir.json.in new file mode 100644 index 0000000..2bb95d9 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresetBinaryDir.json.in @@ -0,0 +1,10 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "InvalidPresetBinaryDir", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": [] + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetGenerator-result.txt b/Tests/RunCMake/CMakePresets/InvalidPresetGenerator-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresetGenerator-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetGenerator-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidPresetGenerator-stderr.txt new file mode 100644 index 0000000..9572875 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresetGenerator-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidPresetGenerator: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetGenerator.json.in b/Tests/RunCMake/CMakePresets/InvalidPresetGenerator.json.in new file mode 100644 index 0000000..95e6e65 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresetGenerator.json.in @@ -0,0 +1,10 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "InvalidPresetGenerator", + "generator": [], + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetName-result.txt b/Tests/RunCMake/CMakePresets/InvalidPresetName-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresetName-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetName-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidPresetName-stderr.txt new file mode 100644 index 0000000..8f6ff7c --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresetName-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidPresetName: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetName.json.in b/Tests/RunCMake/CMakePresets/InvalidPresetName.json.in new file mode 100644 index 0000000..08361da --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresetName.json.in @@ -0,0 +1,10 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": [], + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetVendor-result.txt b/Tests/RunCMake/CMakePresets/InvalidPresetVendor-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresetVendor-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetVendor-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidPresetVendor-stderr.txt new file mode 100644 index 0000000..89a424a --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresetVendor-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidPresetVendor: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/InvalidPresetVendor.json.in b/Tests/RunCMake/CMakePresets/InvalidPresetVendor.json.in new file mode 100644 index 0000000..2a5d9ba --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresetVendor.json.in @@ -0,0 +1,11 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "InvalidPresetVendor", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "vendor": true + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/InvalidPresets-result.txt b/Tests/RunCMake/CMakePresets/InvalidPresets-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresets-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidPresets-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidPresets-stderr.txt new file mode 100644 index 0000000..2b0f560 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresets-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidPresets: Invalid "configurePresets" field$ diff --git a/Tests/RunCMake/CMakePresets/InvalidPresets.json.in b/Tests/RunCMake/CMakePresets/InvalidPresets.json.in new file mode 100644 index 0000000..facfd57 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidPresets.json.in @@ -0,0 +1,4 @@ +{ + "version": 1, + "configurePresets": {} +} diff --git a/Tests/RunCMake/CMakePresets/InvalidRoot-result.txt b/Tests/RunCMake/CMakePresets/InvalidRoot-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidRoot-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidRoot-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidRoot-stderr.txt new file mode 100644 index 0000000..e5c434d --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidRoot-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidRoot: Invalid root object$ diff --git a/Tests/RunCMake/CMakePresets/InvalidRoot.json.in b/Tests/RunCMake/CMakePresets/InvalidRoot.json.in new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidRoot.json.in @@ -0,0 +1 @@ +[] diff --git a/Tests/RunCMake/CMakePresets/InvalidVariableValue-result.txt b/Tests/RunCMake/CMakePresets/InvalidVariableValue-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidVariableValue-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidVariableValue-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidVariableValue-stderr.txt new file mode 100644 index 0000000..0ab07c3 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidVariableValue-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidVariableValue: Invalid CMake variable definition$ diff --git a/Tests/RunCMake/CMakePresets/InvalidVariableValue.json.in b/Tests/RunCMake/CMakePresets/InvalidVariableValue.json.in new file mode 100644 index 0000000..55c7644 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidVariableValue.json.in @@ -0,0 +1,15 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "InvalidVariableValue", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "VAR": { + "value": [] + } + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/InvalidVariables-result.txt b/Tests/RunCMake/CMakePresets/InvalidVariables-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidVariables-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidVariables-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidVariables-stderr.txt new file mode 100644 index 0000000..6d9102a --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidVariables-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidVariables: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/InvalidVariables.json.in b/Tests/RunCMake/CMakePresets/InvalidVariables.json.in new file mode 100644 index 0000000..30dcaf0 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidVariables.json.in @@ -0,0 +1,11 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "InvalidVariables", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cacheVariables": [] + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/InvalidVendor-result.txt b/Tests/RunCMake/CMakePresets/InvalidVendor-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidVendor-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidVendor-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidVendor-stderr.txt new file mode 100644 index 0000000..af923f0 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidVendor-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidVendor: Invalid root object$ diff --git a/Tests/RunCMake/CMakePresets/InvalidVendor.json.in b/Tests/RunCMake/CMakePresets/InvalidVendor.json.in new file mode 100644 index 0000000..2315b72 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidVendor.json.in @@ -0,0 +1,5 @@ +{ + "version": 1, + "vendor": true, + "configurePresets": [] +} diff --git a/Tests/RunCMake/CMakePresets/InvalidVersion-result.txt b/Tests/RunCMake/CMakePresets/InvalidVersion-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidVersion-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/InvalidVersion-stderr.txt b/Tests/RunCMake/CMakePresets/InvalidVersion-stderr.txt new file mode 100644 index 0000000..7e0fcfd --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidVersion-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/InvalidVersion: Invalid "version" field$ diff --git a/Tests/RunCMake/CMakePresets/InvalidVersion.json.in b/Tests/RunCMake/CMakePresets/InvalidVersion.json.in new file mode 100644 index 0000000..e6e19bc --- /dev/null +++ b/Tests/RunCMake/CMakePresets/InvalidVersion.json.in @@ -0,0 +1,4 @@ +{ + "version": "1.0", + "configurePresets": [] +} diff --git a/Tests/RunCMake/CMakePresets/JSONParseError-result.txt b/Tests/RunCMake/CMakePresets/JSONParseError-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/JSONParseError-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/JSONParseError-stderr.txt b/Tests/RunCMake/CMakePresets/JSONParseError-stderr.txt new file mode 100644 index 0000000..a43bf77 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/JSONParseError-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/JSONParseError: JSON parse error$ diff --git a/Tests/RunCMake/CMakePresets/JSONParseError.json.in b/Tests/RunCMake/CMakePresets/JSONParseError.json.in new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/JSONParseError.json.in diff --git a/Tests/RunCMake/CMakePresets/ListPresets-stdout.txt b/Tests/RunCMake/CMakePresets/ListPresets-stdout.txt new file mode 100644 index 0000000..1758f33 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ListPresets-stdout.txt @@ -0,0 +1,6 @@ +^Not searching for unused variables given on the command line\. +Available presets: + + "zzzzzz" - Sleepy + "aaaaaaaa" - Screaming + "mmmmmm"$ diff --git a/Tests/RunCMake/CMakePresets/ListPresets.json.in b/Tests/RunCMake/CMakePresets/ListPresets.json.in new file mode 100644 index 0000000..c7646c6 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ListPresets.json.in @@ -0,0 +1,36 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "zzzzzz", + "displayName": "Sleepy", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build/zzzzzz" + }, + { + "name": "aaaaaaaa", + "displayName": "Screaming", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build/aaaaaaaa" + }, + { + "name": "mmmmmm", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build/mmmmmm" + }, + { + "name": "invalid-generator", + "generator": "Invalid Generator", + "binaryDir": "${sourceDir}/build/invalid" + }, + { + "name": "invalid-macro", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${noexist}" + }, + { + "name": "ListPresetsHidden", + "hidden": true + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/ListPresetsHidden-result.txt b/Tests/RunCMake/CMakePresets/ListPresetsHidden-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ListPresetsHidden-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/ListPresetsHidden-stderr.txt b/Tests/RunCMake/CMakePresets/ListPresetsHidden-stderr.txt new file mode 100644 index 0000000..1403814 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ListPresetsHidden-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Cannot use hidden preset in [^ +]*/Tests/RunCMake/CMakePresets/ListPresetsHidden: "ListPresetsHidden"$ diff --git a/Tests/RunCMake/CMakePresets/ListPresetsHidden-stdout.txt b/Tests/RunCMake/CMakePresets/ListPresetsHidden-stdout.txt new file mode 100644 index 0000000..1758f33 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ListPresetsHidden-stdout.txt @@ -0,0 +1,6 @@ +^Not searching for unused variables given on the command line\. +Available presets: + + "zzzzzz" - Sleepy + "aaaaaaaa" - Screaming + "mmmmmm"$ diff --git a/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-result.txt b/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stderr.txt b/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stderr.txt new file mode 100644 index 0000000..eea1b99 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: No such preset in [^ +]*/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset: "ListPresetsNoSuchPreset"$ diff --git a/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stdout.txt b/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stdout.txt new file mode 100644 index 0000000..1758f33 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ListPresetsNoSuchPreset-stdout.txt @@ -0,0 +1,6 @@ +^Not searching for unused variables given on the command line\. +Available presets: + + "zzzzzz" - Sleepy + "aaaaaaaa" - Screaming + "mmmmmm"$ diff --git a/Tests/RunCMake/CMakePresets/ListPresetsWorkingDir-stdout.txt b/Tests/RunCMake/CMakePresets/ListPresetsWorkingDir-stdout.txt new file mode 100644 index 0000000..1758f33 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ListPresetsWorkingDir-stdout.txt @@ -0,0 +1,6 @@ +^Not searching for unused variables given on the command line\. +Available presets: + + "zzzzzz" - Sleepy + "aaaaaaaa" - Screaming + "mmmmmm"$ diff --git a/Tests/RunCMake/CMakePresets/LowVersion-result.txt b/Tests/RunCMake/CMakePresets/LowVersion-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/LowVersion-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/LowVersion-stderr.txt b/Tests/RunCMake/CMakePresets/LowVersion-stderr.txt new file mode 100644 index 0000000..92b3723 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/LowVersion-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/LowVersion: Unrecognized "version" field$ diff --git a/Tests/RunCMake/CMakePresets/LowVersion.json.in b/Tests/RunCMake/CMakePresets/LowVersion.json.in new file mode 100644 index 0000000..e03afa9 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/LowVersion.json.in @@ -0,0 +1,4 @@ +{ + "version": 0, + "configurePresets": [] +} diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredEmpty.cmake b/Tests/RunCMake/CMakePresets/MinimumRequiredEmpty.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredEmpty.cmake diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredEmpty.json.in b/Tests/RunCMake/CMakePresets/MinimumRequiredEmpty.json.in new file mode 100644 index 0000000..37740ef --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredEmpty.json.in @@ -0,0 +1,11 @@ +{ + "version": 1, + "cmakeMinimumRequired": {}, + "configurePresets": [ + { + "name": "MinimumRequiredEmpty", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid-result.txt b/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid-stderr.txt b/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid-stderr.txt new file mode 100644 index 0000000..6548caf --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid: Invalid "cmakeMinimumRequired" field$ diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid.json.in b/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid.json.in new file mode 100644 index 0000000..da79603 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredInvalid.json.in @@ -0,0 +1,11 @@ +{ + "version": 1, + "cmakeMinimumRequired": "3.18", + "configurePresets": [ + { + "name": "MinimumRequiredInvalid", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredMajor-result.txt b/Tests/RunCMake/CMakePresets/MinimumRequiredMajor-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredMajor-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredMajor-stderr.txt b/Tests/RunCMake/CMakePresets/MinimumRequiredMajor-stderr.txt new file mode 100644 index 0000000..6036fe3 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredMajor-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/MinimumRequiredMajor: "cmakeMinimumRequired" version too new$ diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredMajor.json.in b/Tests/RunCMake/CMakePresets/MinimumRequiredMajor.json.in new file mode 100644 index 0000000..a17cdf6 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredMajor.json.in @@ -0,0 +1,13 @@ +{ + "version": 1, + "cmakeMinimumRequired": { + "major": 1000 + }, + "configurePresets": [ + { + "name": "MinimumRequiredMajor", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredMinor-result.txt b/Tests/RunCMake/CMakePresets/MinimumRequiredMinor-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredMinor-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredMinor-stderr.txt b/Tests/RunCMake/CMakePresets/MinimumRequiredMinor-stderr.txt new file mode 100644 index 0000000..bdee4cd --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredMinor-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/MinimumRequiredMinor: "cmakeMinimumRequired" version too new$ diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredMinor.json.in b/Tests/RunCMake/CMakePresets/MinimumRequiredMinor.json.in new file mode 100644 index 0000000..33a8816 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredMinor.json.in @@ -0,0 +1,14 @@ +{ + "version": 1, + "cmakeMinimumRequired": { + "major": @CMAKE_MAJOR_VERSION@, + "minor": 1000 + }, + "configurePresets": [ + { + "name": "MinimumRequiredMinor", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredPatch-result.txt b/Tests/RunCMake/CMakePresets/MinimumRequiredPatch-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredPatch-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredPatch-stderr.txt b/Tests/RunCMake/CMakePresets/MinimumRequiredPatch-stderr.txt new file mode 100644 index 0000000..b5d3a39 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredPatch-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/MinimumRequiredPatch: "cmakeMinimumRequired" version too new$ diff --git a/Tests/RunCMake/CMakePresets/MinimumRequiredPatch.json.in b/Tests/RunCMake/CMakePresets/MinimumRequiredPatch.json.in new file mode 100644 index 0000000..4a53f8d --- /dev/null +++ b/Tests/RunCMake/CMakePresets/MinimumRequiredPatch.json.in @@ -0,0 +1,15 @@ +{ + "version": 1, + "cmakeMinimumRequired": { + "major": @CMAKE_MAJOR_VERSION@, + "minor": @CMAKE_MINOR_VERSION@, + "patch": 50000000 + }, + "configurePresets": [ + { + "name": "MinimumRequiredPatch", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/NoCMakePresets-result.txt b/Tests/RunCMake/CMakePresets/NoCMakePresets-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoCMakePresets-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/NoCMakePresets-stderr.txt b/Tests/RunCMake/CMakePresets/NoCMakePresets-stderr.txt new file mode 100644 index 0000000..c807ffc --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoCMakePresets-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/NoCMakePresets: File not found$ diff --git a/Tests/RunCMake/CMakePresets/NoDebug-stdout.txt b/Tests/RunCMake/CMakePresets/NoDebug-stdout.txt new file mode 100644 index 0000000..c23ab89 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoDebug-stdout.txt @@ -0,0 +1,2 @@ +-- Configuring done +-- Generating done diff --git a/Tests/RunCMake/CMakePresets/NoDebug.cmake b/Tests/RunCMake/CMakePresets/NoDebug.cmake new file mode 100644 index 0000000..f2b3d4a --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoDebug.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_LIST_DIR}/DebugBase.cmake) +if(EXISTS "${CMAKE_BINARY_DIR}/CMakeFiles/CMakeTmp/CMakeLists.txt") + message(SEND_ERROR "Not debugging try_compile() did not work") +endif() diff --git a/Tests/RunCMake/CMakePresets/NoPresetArgument-result.txt b/Tests/RunCMake/CMakePresets/NoPresetArgument-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresetArgument-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/NoPresetArgument-stderr.txt b/Tests/RunCMake/CMakePresets/NoPresetArgument-stderr.txt new file mode 100644 index 0000000..aef30d2 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresetArgument-stderr.txt @@ -0,0 +1 @@ +^CMake Error: No preset specified for --preset$ diff --git a/Tests/RunCMake/CMakePresets/NoPresetBinaryDir-result.txt b/Tests/RunCMake/CMakePresets/NoPresetBinaryDir-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresetBinaryDir-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/NoPresetBinaryDir-stderr.txt b/Tests/RunCMake/CMakePresets/NoPresetBinaryDir-stderr.txt new file mode 100644 index 0000000..b525fc3 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresetBinaryDir-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/NoPresetBinaryDir: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/NoPresetBinaryDir.json.in b/Tests/RunCMake/CMakePresets/NoPresetBinaryDir.json.in new file mode 100644 index 0000000..8989cfd --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresetBinaryDir.json.in @@ -0,0 +1,9 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "NoPresetBinaryDir", + "generator": "@RunCMake_GENERATOR@" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/NoPresetGenerator-result.txt b/Tests/RunCMake/CMakePresets/NoPresetGenerator-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresetGenerator-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/NoPresetGenerator-stderr.txt b/Tests/RunCMake/CMakePresets/NoPresetGenerator-stderr.txt new file mode 100644 index 0000000..6c0c9f7 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresetGenerator-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/NoPresetGenerator: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/NoPresetGenerator.json.in b/Tests/RunCMake/CMakePresets/NoPresetGenerator.json.in new file mode 100644 index 0000000..74f83b7 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresetGenerator.json.in @@ -0,0 +1,9 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "NoPresetGenerator", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/NoPresetName-result.txt b/Tests/RunCMake/CMakePresets/NoPresetName-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresetName-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/NoPresetName-stderr.txt b/Tests/RunCMake/CMakePresets/NoPresetName-stderr.txt new file mode 100644 index 0000000..0ee338a --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresetName-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/NoPresetName: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/NoPresetName.json.in b/Tests/RunCMake/CMakePresets/NoPresetName.json.in new file mode 100644 index 0000000..373591d --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresetName.json.in @@ -0,0 +1,9 @@ +{ + "version": 1, + "configurePresets": [ + { + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/NoPresets-result.txt b/Tests/RunCMake/CMakePresets/NoPresets-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresets-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/NoPresets-stderr.txt b/Tests/RunCMake/CMakePresets/NoPresets-stderr.txt new file mode 100644 index 0000000..5ff3d33 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresets-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: No such preset in [^ +]*/Tests/RunCMake/CMakePresets/NoPresets: "NoPresets"$ diff --git a/Tests/RunCMake/CMakePresets/NoPresets-stdout.txt b/Tests/RunCMake/CMakePresets/NoPresets-stdout.txt new file mode 100644 index 0000000..cb01a02 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresets-stdout.txt @@ -0,0 +1 @@ +^Not searching for unused variables given on the command line\.$ diff --git a/Tests/RunCMake/CMakePresets/NoPresets.json.in b/Tests/RunCMake/CMakePresets/NoPresets.json.in new file mode 100644 index 0000000..61a2092 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoPresets.json.in @@ -0,0 +1,3 @@ +{ + "version": 1 +} diff --git a/Tests/RunCMake/CMakePresets/NoSuchMacro-result.txt b/Tests/RunCMake/CMakePresets/NoSuchMacro-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoSuchMacro-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/NoSuchMacro-stderr.txt b/Tests/RunCMake/CMakePresets/NoSuchMacro-stderr.txt new file mode 100644 index 0000000..08fa87b --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoSuchMacro-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Could not evaluate preset "NoSuchMacro": Invalid macro expansion$ diff --git a/Tests/RunCMake/CMakePresets/NoSuchPreset-result.txt b/Tests/RunCMake/CMakePresets/NoSuchPreset-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoSuchPreset-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/NoSuchPreset-stderr.txt b/Tests/RunCMake/CMakePresets/NoSuchPreset-stderr.txt new file mode 100644 index 0000000..9a2d0d5 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoSuchPreset-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: No such preset in [^ +]*/Tests/RunCMake/CMakePresets/NoSuchPreset: "NoSuchPreset"$ diff --git a/Tests/RunCMake/CMakePresets/NoVariableValue-result.txt b/Tests/RunCMake/CMakePresets/NoVariableValue-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoVariableValue-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/NoVariableValue-stderr.txt b/Tests/RunCMake/CMakePresets/NoVariableValue-stderr.txt new file mode 100644 index 0000000..cdab32f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoVariableValue-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/NoVariableValue: Invalid CMake variable definition$ diff --git a/Tests/RunCMake/CMakePresets/NoVariableValue.json.in b/Tests/RunCMake/CMakePresets/NoVariableValue.json.in new file mode 100644 index 0000000..482700d --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoVariableValue.json.in @@ -0,0 +1,13 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "NoVariableValue", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "VAR": {} + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/NoVersion-result.txt b/Tests/RunCMake/CMakePresets/NoVersion-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoVersion-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/NoVersion-stderr.txt b/Tests/RunCMake/CMakePresets/NoVersion-stderr.txt new file mode 100644 index 0000000..d4f07e4 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoVersion-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/NoVersion: No "version" field$ diff --git a/Tests/RunCMake/CMakePresets/NoVersion.json.in b/Tests/RunCMake/CMakePresets/NoVersion.json.in new file mode 100644 index 0000000..3fe8332 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoVersion.json.in @@ -0,0 +1,3 @@ +{ + "configurePresets": [] +} diff --git a/Tests/RunCMake/CMakePresets/NoWarningFlags-stderr.txt b/Tests/RunCMake/CMakePresets/NoWarningFlags-stderr.txt new file mode 100644 index 0000000..a16d362 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoWarningFlags-stderr.txt @@ -0,0 +1,23 @@ +^CMake Warning \(dev\) at [^ +]*/Tests/RunCMake/CMakePresets/WarningsBase\.cmake:[0-9]+ \(message\): + Dev warning +Call Stack \(most recent call first\): + [^ +]*/Tests/RunCMake/CMakePresets/NoWarningFlags\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\. + +CMake Deprecation Warning at [^ +]*/Tests/RunCMake/CMakePresets/WarningsBase\.cmake:[0-9]+ \(message\): + Deprecation warning +Call Stack \(most recent call first\): + [^ +]*/Tests/RunCMake/CMakePresets/NoWarningFlags\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\) + + +CMake Warning: + Manually-specified variables were not used by the project: + + RunCMake_GENERATOR + UNUSED_VARIABLE$ diff --git a/Tests/RunCMake/CMakePresets/NoWarningFlags.cmake b/Tests/RunCMake/CMakePresets/NoWarningFlags.cmake new file mode 100644 index 0000000..5de7687 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoWarningFlags.cmake @@ -0,0 +1 @@ +include(${CMAKE_CURRENT_LIST_DIR}/WarningsBase.cmake) diff --git a/Tests/RunCMake/CMakePresets/PresetNotObject-result.txt b/Tests/RunCMake/CMakePresets/PresetNotObject-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/PresetNotObject-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/PresetNotObject-stderr.txt b/Tests/RunCMake/CMakePresets/PresetNotObject-stderr.txt new file mode 100644 index 0000000..6604a14 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/PresetNotObject-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/PresetNotObject: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/PresetNotObject.json.in b/Tests/RunCMake/CMakePresets/PresetNotObject.json.in new file mode 100644 index 0000000..d5892fc --- /dev/null +++ b/Tests/RunCMake/CMakePresets/PresetNotObject.json.in @@ -0,0 +1,6 @@ +{ + "version": 1, + "configurePresets": [ + [] + ] +} diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake new file mode 100644 index 0000000..f591964 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake @@ -0,0 +1,212 @@ +include(RunCMake) + +# Fix Visual Studio generator name +if(RunCMake_GENERATOR MATCHES "^(Visual Studio [0-9]+ [0-9]+) ") + set(RunCMake_GENERATOR "${CMAKE_MATCH_1}") +endif() + +function(run_cmake_presets name) + set(RunCMake_TEST_SOURCE_DIR "${RunCMake_BINARY_DIR}/${name}") + set(_source_arg "${RunCMake_TEST_SOURCE_DIR}") + if(CMakePresets_RELATIVE_SOURCE) + set(_source_arg "../${name}") + endif() + file(REMOVE_RECURSE "${RunCMake_TEST_SOURCE_DIR}") + file(MAKE_DIRECTORY "${RunCMake_TEST_SOURCE_DIR}") + configure_file("${RunCMake_SOURCE_DIR}/CMakeLists.txt.in" "${RunCMake_TEST_SOURCE_DIR}/CMakeLists.txt" @ONLY) + + if(NOT CMakePresets_FILE) + set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/${name}.json.in") + endif() + if(EXISTS "${CMakePresets_FILE}") + configure_file("${CMakePresets_FILE}" "${RunCMake_TEST_SOURCE_DIR}/CMakePresets.json" @ONLY) + endif() + + if(NOT CMakeUserPresets_FILE) + set(CMakeUserPresets_FILE "${RunCMake_SOURCE_DIR}/${name}User.json.in") + endif() + if(EXISTS "${CMakeUserPresets_FILE}") + configure_file("${CMakeUserPresets_FILE}" "${RunCMake_TEST_SOURCE_DIR}/CMakeUserPresets.json" @ONLY) + endif() + + set(_s_arg -S) + if(CMakePresets_NO_S_ARG) + set(_s_arg) + endif() + set(_source_args ${_s_arg} ${_source_arg}) + if(CMakePresets_NO_SOURCE_ARGS) + set(_source_args) + endif() + set(_unused_cli --no-warn-unused-cli) + if(CMakePresets_WARN_UNUSED_CLI) + set(_unused_cli) + endif() + + set(RunCMake_TEST_COMMAND ${CMAKE_COMMAND} + ${_source_args} + -DRunCMake_TEST=${name} + -DRunCMake_GENERATOR=${RunCMake_GENERATOR} + -DCMAKE_MAKE_PROGRAM=${RunCMake_MAKE_PROGRAM} + ${_unused_cli} + --preset=${name} + ${ARGN} + ) + run_cmake(${name}) +endfunction() + +# Test CMakePresets.json errors +run_cmake_presets(NoCMakePresets) +run_cmake_presets(JSONParseError) +run_cmake_presets(InvalidRoot) +run_cmake_presets(NoVersion) +run_cmake_presets(InvalidVersion) +run_cmake_presets(LowVersion) +run_cmake_presets(HighVersion) +run_cmake_presets(InvalidVendor) +run_cmake_presets(NoPresets) +run_cmake_presets(InvalidPresets) +run_cmake_presets(PresetNotObject) +run_cmake_presets(NoPresetName) +run_cmake_presets(InvalidPresetName) +run_cmake_presets(EmptyPresetName) +run_cmake_presets(NoPresetGenerator) +run_cmake_presets(InvalidPresetGenerator) +run_cmake_presets(NoPresetBinaryDir) +run_cmake_presets(InvalidPresetBinaryDir) +run_cmake_presets(InvalidVariables) +run_cmake_presets(VariableNotObject) +run_cmake_presets(NoVariableValue) +run_cmake_presets(InvalidVariableValue) +run_cmake_presets(ExtraRootField) +run_cmake_presets(ExtraPresetField) +run_cmake_presets(ExtraVariableField) +run_cmake_presets(InvalidPresetVendor) +run_cmake_presets(DuplicatePresets) +run_cmake_presets(CyclicInheritance0) +run_cmake_presets(CyclicInheritance1) +run_cmake_presets(CyclicInheritance2) +run_cmake_presets(InvalidInheritance) +run_cmake_presets(ErrorNoWarningDev) +run_cmake_presets(ErrorNoWarningDeprecated) +run_cmake_presets(InvalidCMakeGeneratorConfig) +run_cmake_presets(UnknownCMakeGeneratorConfig) + +# Test cmakeMinimumRequired field +run_cmake_presets(MinimumRequiredInvalid) +run_cmake_presets(MinimumRequiredEmpty) +run_cmake_presets(MinimumRequiredMajor) +run_cmake_presets(MinimumRequiredMinor) +run_cmake_presets(MinimumRequiredPatch) + +# Test properly working CMakePresets.json +set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/CMakePresets.json.in") +unset(ENV{TEST_ENV}) +unset(ENV{TEST_ENV_REF}) +unset(ENV{TEST_D_ENV_REF}) +set(ENV{TEST_ENV_OVERRIDE} "This environment variable will be overridden") +set(ENV{TEST_PENV} "Process environment variable") +set(ENV{TEST_ENV_REF_PENV} "suffix") +run_cmake_presets(Good "-DTEST_OVERRIDE_1=Overridden value" "-DTEST_OVERRIDE_2:STRING=Overridden value" -C "${RunCMake_SOURCE_DIR}/CacheOverride.cmake" "-UTEST_UNDEF") +unset(ENV{TEST_ENV_OVERRIDE}) +unset(ENV{TEST_PENV}) +unset(ENV{TEST_ENV_REF_PENV}) +run_cmake_presets(GoodNoArgs) +file(REMOVE_RECURSE ${RunCMake_BINARY_DIR}/GoodBinaryUp-build) +run_cmake_presets(GoodBinaryUp) +set(CMakePresets_RELATIVE_SOURCE TRUE) +run_cmake_presets(GoodBinaryRelative) +unset(CMakePresets_RELATIVE_SOURCE) +run_cmake_presets(GoodSpaces "--preset=Good Spaces") +if(WIN32) + run_cmake_presets(GoodWindowsBackslash) +endif() +set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/GoodBOM.json.in") +run_cmake_presets(GoodBOM) +set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/CMakePresets.json.in") +file(REMOVE_RECURSE ${RunCMake_BINARY_DIR}/GoodBinaryCmdLine-build) +run_cmake_presets(GoodBinaryCmdLine -B ${RunCMake_BINARY_DIR}/GoodBinaryCmdLine-build) +run_cmake_presets(GoodGeneratorCmdLine -G ${RunCMake_GENERATOR}) +run_cmake_presets(InvalidGeneratorCmdLine -G "Invalid Generator") +set(CMakePresets_NO_S_ARG TRUE) +run_cmake_presets(GoodNoS) +unset(CMakePresets_NO_S_ARG) +run_cmake_presets(GoodInheritanceParent) +run_cmake_presets(GoodInheritanceChild) +run_cmake_presets(GoodInheritanceOverride) +run_cmake_presets(GoodInheritanceMulti) +run_cmake_presets(GoodInheritanceMultiSecond) +run_cmake_presets(GoodInheritanceMacro) + +# Test bad preset arguments +run_cmake_presets(UnclosedMacro) +run_cmake_presets(NoSuchMacro) +run_cmake_presets(VendorMacro) +run_cmake_presets(InvalidGenerator) +run_cmake_presets(EnvCycle) + +# Test Visual Studio-specific stuff +if(RunCMake_GENERATOR MATCHES "^Visual Studio ") + run_cmake_presets(VisualStudioGeneratorArch) + run_cmake_presets(VisualStudioWin32) + run_cmake_presets(VisualStudioWin64) + run_cmake_presets(VisualStudioWin32Override -A x64) + if(NOT RunCMake_GENERATOR STREQUAL "Visual Studio 9 2008") + run_cmake_presets(VisualStudioToolset) + run_cmake_presets(VisualStudioToolsetOverride -T "Test Toolset") + run_cmake_presets(VisualStudioInheritanceParent) + run_cmake_presets(VisualStudioInheritanceChild) + run_cmake_presets(VisualStudioInheritanceOverride) + run_cmake_presets(VisualStudioInheritanceMulti) + run_cmake_presets(VisualStudioInheritanceMultiSecond) + endif() +else() + run_cmake_presets(CMakeGeneratorConfigNone) + run_cmake_presets(CMakeGeneratorConfigDefault) + run_cmake_presets(CMakeGeneratorConfigIgnore) +endif() + +# Test bad command line arguments +run_cmake_presets(NoSuchPreset) +run_cmake_presets(NoPresetArgument --preset=) +run_cmake_presets(UseHiddenPreset) + +# Test CMakeUserPresets.json +unset(CMakePresets_FILE) +run_cmake_presets(GoodUserOnly) +run_cmake_presets(GoodUserFromMain) +run_cmake_presets(GoodUserFromUser) + +# Test CMakeUserPresets.json errors +run_cmake_presets(UserDuplicateInUser) +run_cmake_presets(UserDuplicateCross) +run_cmake_presets(UserInheritance) + +# Test listing presets +set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/ListPresets.json.in") +run_cmake_presets(ListPresets --list-presets) + +set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/ListPresetsWorkingDir") +set(RunCMake_TEST_NO_CLEAN 1) +set(CMakePresets_NO_SOURCE_ARGS 1) +run_cmake_presets(ListPresetsWorkingDir --list-presets) +unset(CMakePresets_NO_SOURCE_ARGS) +unset(RunCMake_TEST_NO_CLEAN) +unset(RunCMake_TEST_BINARY_DIR) + +run_cmake_presets(ListPresetsNoSuchPreset) +run_cmake_presets(ListPresetsHidden) + +# Test warning and error flags +set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/Warnings.json.in") +set(CMakePresets_WARN_UNUSED_CLI 1) +run_cmake_presets(NoWarningFlags) +run_cmake_presets(WarningFlags) +run_cmake_presets(DisableWarningFlags) +run_cmake_presets(ErrorDev) +run_cmake_presets(ErrorDeprecated) +unset(CMakePresets_WARN_UNUSED_CLI) + +# Test debug +set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/Debug.json.in") +run_cmake_presets(NoDebug) +run_cmake_presets(Debug) diff --git a/Tests/RunCMake/CMakePresets/TestVariable.cmake b/Tests/RunCMake/CMakePresets/TestVariable.cmake new file mode 100644 index 0000000..934af52 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TestVariable.cmake @@ -0,0 +1,25 @@ +function(test_variable name expected_type expected_value) + if(NOT DEFINED "${name}") + message(SEND_ERROR "${name} is not defined") + elseif(NOT "${${name}}" STREQUAL expected_value) + message(SEND_ERROR "Expected value of ${name}: \"${expected_value}\"\nActual value: \"${${name}}\"") + endif() + if(expected_type) + if(NOT DEFINED "CACHE{${name}}") + message(SEND_ERROR "Cache entry ${name} does not exist") + else() + get_property(type CACHE ${name} PROPERTY TYPE) + if(NOT type STREQUAL expected_type) + message(SEND_ERROR "Expected type of ${name}: \"${expected_type}\"\nActual type: \"${type}\"") + endif() + endif() + endif() +endfunction() + +function(test_environment_variable name expected_value) + if(NOT DEFINED "ENV{${name}}") + message(SEND_ERROR "Environment variable ${name} is not defined") + elseif(NOT "$ENV{${name}}" STREQUAL expected_value) + message(SEND_ERROR "Expected value of environment variable ${name}: \"${expected_value}\"\nActual value: \"$ENV{${name}}\"") + endif() +endfunction() diff --git a/Tests/RunCMake/CMakePresets/UnclosedMacro-result.txt b/Tests/RunCMake/CMakePresets/UnclosedMacro-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UnclosedMacro-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/UnclosedMacro-stderr.txt b/Tests/RunCMake/CMakePresets/UnclosedMacro-stderr.txt new file mode 100644 index 0000000..248510d --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UnclosedMacro-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Could not evaluate preset "UnclosedMacro": Invalid macro expansion$ diff --git a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-result.txt b/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-stderr.txt b/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-stderr.txt new file mode 100644 index 0000000..b1759b0 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig: Invalid preset$ diff --git a/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig.json.in b/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig.json.in new file mode 100644 index 0000000..900c6df --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UnknownCMakeGeneratorConfig.json.in @@ -0,0 +1,11 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "UnknownCMakeGeneratorConfig", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cmakeGeneratorConfig": "unknown" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/UseHiddenPreset-result.txt b/Tests/RunCMake/CMakePresets/UseHiddenPreset-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UseHiddenPreset-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/UseHiddenPreset-stderr.txt b/Tests/RunCMake/CMakePresets/UseHiddenPreset-stderr.txt new file mode 100644 index 0000000..45b4cd4 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UseHiddenPreset-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Cannot use hidden preset in [^ +]*/Tests/RunCMake/CMakePresets/UseHiddenPreset: "UseHiddenPreset"$ diff --git a/Tests/RunCMake/CMakePresets/UserDuplicateCross-result.txt b/Tests/RunCMake/CMakePresets/UserDuplicateCross-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UserDuplicateCross-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/UserDuplicateCross-stderr.txt b/Tests/RunCMake/CMakePresets/UserDuplicateCross-stderr.txt new file mode 100644 index 0000000..125265f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UserDuplicateCross-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/UserDuplicateCross: Duplicate presets$ diff --git a/Tests/RunCMake/CMakePresets/UserDuplicateCross.json.in b/Tests/RunCMake/CMakePresets/UserDuplicateCross.json.in new file mode 100644 index 0000000..172cfba --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UserDuplicateCross.json.in @@ -0,0 +1,10 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "UserDuplicateCross", + "generator": "@RunCMake_GENERATOR", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/UserDuplicateCrossUser.json.in b/Tests/RunCMake/CMakePresets/UserDuplicateCrossUser.json.in new file mode 100644 index 0000000..172cfba --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UserDuplicateCrossUser.json.in @@ -0,0 +1,10 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "UserDuplicateCross", + "generator": "@RunCMake_GENERATOR", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/UserDuplicateInUser-result.txt b/Tests/RunCMake/CMakePresets/UserDuplicateInUser-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UserDuplicateInUser-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/UserDuplicateInUser-stderr.txt b/Tests/RunCMake/CMakePresets/UserDuplicateInUser-stderr.txt new file mode 100644 index 0000000..1071b17 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UserDuplicateInUser-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/UserDuplicateInUser: Duplicate presets$ diff --git a/Tests/RunCMake/CMakePresets/UserDuplicateInUserUser.json.in b/Tests/RunCMake/CMakePresets/UserDuplicateInUserUser.json.in new file mode 100644 index 0000000..365fafe --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UserDuplicateInUserUser.json.in @@ -0,0 +1,15 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "UserDuplicateInUser", + "generator": "@RunCMake_GENERATOR", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "UserDuplicateInUser", + "generator": "@RunCMake_GENERATOR", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/UserInheritance-result.txt b/Tests/RunCMake/CMakePresets/UserInheritance-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UserInheritance-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/UserInheritance-stderr.txt b/Tests/RunCMake/CMakePresets/UserInheritance-stderr.txt new file mode 100644 index 0000000..213215a --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UserInheritance-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/UserInheritance: Project preset inherits from user preset$ diff --git a/Tests/RunCMake/CMakePresets/UserInheritance.json.in b/Tests/RunCMake/CMakePresets/UserInheritance.json.in new file mode 100644 index 0000000..d9973d7 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UserInheritance.json.in @@ -0,0 +1,13 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "UserInheritance", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "inherits": [ + "UserInheritanceUser" + ] + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/UserInheritanceUser.json.in b/Tests/RunCMake/CMakePresets/UserInheritanceUser.json.in new file mode 100644 index 0000000..1321a73 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/UserInheritanceUser.json.in @@ -0,0 +1,10 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "UserInheritanceUser", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/VariableNotObject-result.txt b/Tests/RunCMake/CMakePresets/VariableNotObject-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VariableNotObject-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/VariableNotObject-stderr.txt b/Tests/RunCMake/CMakePresets/VariableNotObject-stderr.txt new file mode 100644 index 0000000..8cacb0a --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VariableNotObject-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/VariableNotObject: Invalid CMake variable definition$ diff --git a/Tests/RunCMake/CMakePresets/VariableNotObject.json.in b/Tests/RunCMake/CMakePresets/VariableNotObject.json.in new file mode 100644 index 0000000..51298f5 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VariableNotObject.json.in @@ -0,0 +1,13 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "VariableNotObject", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "VAR": [] + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/VendorMacro-result.txt b/Tests/RunCMake/CMakePresets/VendorMacro-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VendorMacro-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/VendorMacro-stderr.txt b/Tests/RunCMake/CMakePresets/VendorMacro-stderr.txt new file mode 100644 index 0000000..2e98019 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VendorMacro-stderr.txt @@ -0,0 +1 @@ +^CMake Error: Could not evaluate preset "VendorMacro": Invalid macro expansion$ diff --git a/Tests/RunCMake/CMakePresets/VisualStudioGeneratorArch-result.txt b/Tests/RunCMake/CMakePresets/VisualStudioGeneratorArch-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VisualStudioGeneratorArch-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/VisualStudioGeneratorArch-stderr.txt b/Tests/RunCMake/CMakePresets/VisualStudioGeneratorArch-stderr.txt new file mode 100644 index 0000000..a311321 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VisualStudioGeneratorArch-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error: Could not create named generator Visual Studio [^ +]* Win64 +Using platforms in Visual Studio generator names is not supported in CMakePresets\.json\. + +Generators diff --git a/Tests/RunCMake/CMakePresets/VisualStudioInheritanceChild.cmake b/Tests/RunCMake/CMakePresets/VisualStudioInheritanceChild.cmake new file mode 100644 index 0000000..d485ab3 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VisualStudioInheritanceChild.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_VS_PLATFORM_NAME "" "Test Platform") +test_variable(CMAKE_VS_PLATFORM_TOOLSET "" "Test Toolset") diff --git a/Tests/RunCMake/CMakePresets/VisualStudioInheritanceMulti.cmake b/Tests/RunCMake/CMakePresets/VisualStudioInheritanceMulti.cmake new file mode 100644 index 0000000..d485ab3 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VisualStudioInheritanceMulti.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_VS_PLATFORM_NAME "" "Test Platform") +test_variable(CMAKE_VS_PLATFORM_TOOLSET "" "Test Toolset") diff --git a/Tests/RunCMake/CMakePresets/VisualStudioInheritanceMultiSecond.cmake b/Tests/RunCMake/CMakePresets/VisualStudioInheritanceMultiSecond.cmake new file mode 100644 index 0000000..d485ab3 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VisualStudioInheritanceMultiSecond.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_VS_PLATFORM_NAME "" "Test Platform") +test_variable(CMAKE_VS_PLATFORM_TOOLSET "" "Test Toolset") diff --git a/Tests/RunCMake/CMakePresets/VisualStudioInheritanceOverride.cmake b/Tests/RunCMake/CMakePresets/VisualStudioInheritanceOverride.cmake new file mode 100644 index 0000000..d485ab3 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VisualStudioInheritanceOverride.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_VS_PLATFORM_NAME "" "Test Platform") +test_variable(CMAKE_VS_PLATFORM_TOOLSET "" "Test Toolset") diff --git a/Tests/RunCMake/CMakePresets/VisualStudioInheritanceParent.cmake b/Tests/RunCMake/CMakePresets/VisualStudioInheritanceParent.cmake new file mode 100644 index 0000000..d485ab3 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VisualStudioInheritanceParent.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_VS_PLATFORM_NAME "" "Test Platform") +test_variable(CMAKE_VS_PLATFORM_TOOLSET "" "Test Toolset") diff --git a/Tests/RunCMake/CMakePresets/VisualStudioToolset.cmake b/Tests/RunCMake/CMakePresets/VisualStudioToolset.cmake new file mode 100644 index 0000000..722e976 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VisualStudioToolset.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_VS_PLATFORM_TOOLSET "" "Test Toolset") diff --git a/Tests/RunCMake/CMakePresets/VisualStudioToolsetOverride.cmake b/Tests/RunCMake/CMakePresets/VisualStudioToolsetOverride.cmake new file mode 100644 index 0000000..722e976 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VisualStudioToolsetOverride.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_VS_PLATFORM_TOOLSET "" "Test Toolset") diff --git a/Tests/RunCMake/CMakePresets/VisualStudioWin32.cmake b/Tests/RunCMake/CMakePresets/VisualStudioWin32.cmake new file mode 100644 index 0000000..a1c61b4 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VisualStudioWin32.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_VS_PLATFORM_NAME "" "Win32") diff --git a/Tests/RunCMake/CMakePresets/VisualStudioWin32Override.cmake b/Tests/RunCMake/CMakePresets/VisualStudioWin32Override.cmake new file mode 100644 index 0000000..b3464d6 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VisualStudioWin32Override.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_VS_PLATFORM_NAME "" "x64") diff --git a/Tests/RunCMake/CMakePresets/VisualStudioWin64.cmake b/Tests/RunCMake/CMakePresets/VisualStudioWin64.cmake new file mode 100644 index 0000000..b3464d6 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/VisualStudioWin64.cmake @@ -0,0 +1,3 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TestVariable.cmake) + +test_variable(CMAKE_VS_PLATFORM_NAME "" "x64") diff --git a/Tests/RunCMake/CMakePresets/WarningFlags-stderr.txt b/Tests/RunCMake/CMakePresets/WarningFlags-stderr.txt new file mode 100644 index 0000000..6e488a9 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/WarningFlags-stderr.txt @@ -0,0 +1,34 @@ +^CMake Warning \(dev\) at [^ +]*/Modules/[^/ +]*:[0-9]+ \([a-zA-Z_][a-zA-Z0-9_]*\): + uninitialized variable '[^ +]*' +Call Stack \(most recent call first\): + CMakeLists\.txt:[0-9]+ \(project\) +This warning is for project developers\. Use -Wno-dev to suppress it\..* +CMake Warning \(dev\) at [^ +]*/Tests/RunCMake/CMakePresets/WarningsBase\.cmake:[0-9]+ \(message\): + Dev warning +Call Stack \(most recent call first\): + [^ +]*/Tests/RunCMake/CMakePresets/WarningFlags\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\. + +CMake Deprecation Warning at [^ +]*/Tests/RunCMake/CMakePresets/WarningsBase\.cmake:[0-9]+ \(message\): + Deprecation warning +Call Stack \(most recent call first\): + [^ +]*/Tests/RunCMake/CMakePresets/WarningFlags\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\) + + +CMake Warning \(dev\) at [^ +]*/Tests/RunCMake/CMakePresets/WarningsBase\.cmake:[0-9]+ \(set\): + uninitialized variable 'UNINITIALIZED_VARIABLE' +Call Stack \(most recent call first\): + [^ +]*/Tests/RunCMake/CMakePresets/WarningFlags\.cmake:[0-9]+ \(include\) + CMakeLists\.txt:[0-9]+ \(include\) +This warning is for project developers\. Use -Wno-dev to suppress it\.$ diff --git a/Tests/RunCMake/CMakePresets/WarningFlags.cmake b/Tests/RunCMake/CMakePresets/WarningFlags.cmake new file mode 100644 index 0000000..5de7687 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/WarningFlags.cmake @@ -0,0 +1 @@ +include(${CMAKE_CURRENT_LIST_DIR}/WarningsBase.cmake) diff --git a/Tests/RunCMake/CMakePresets/Warnings.json.in b/Tests/RunCMake/CMakePresets/Warnings.json.in new file mode 100644 index 0000000..40ec6ce --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Warnings.json.in @@ -0,0 +1,50 @@ +{ + "version": 1, + "configurePresets": [ + { + "name": "NoWarningFlags", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "cacheVariables": { + "UNUSED_VARIABLE": "Unused" + } + }, + { + "name": "WarningFlags", + "inherits": "NoWarningFlags", + "warnings": { + "dev": true, + "deprecated": true, + "uninitialized": true, + "unusedCli": false, + "systemVars": true + } + }, + { + "name": "DisableWarningFlags", + "inherits": "NoWarningFlags", + "warnings": { + "dev": false, + "deprecated": false, + "unusedCli": false + } + }, + { + "name": "ErrorDev", + "inherits": "NoWarningFlags", + "errors": { + "dev": true + } + }, + { + "name": "ErrorDeprecated", + "inherits": "NoWarningFlags", + "warnings": { + "dev": false + }, + "errors": { + "deprecated": true + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/WarningsBase.cmake b/Tests/RunCMake/CMakePresets/WarningsBase.cmake new file mode 100644 index 0000000..1a434dc --- /dev/null +++ b/Tests/RunCMake/CMakePresets/WarningsBase.cmake @@ -0,0 +1,3 @@ +message(AUTHOR_WARNING "Dev warning") +message(DEPRECATION "Deprecation warning") +set(_uninitialized "${UNINITIALIZED_VARIABLE}") diff --git a/Tests/RunCMake/CMakePresets/main.c b/Tests/RunCMake/CMakePresets/main.c new file mode 100644 index 0000000..8488f4e --- /dev/null +++ b/Tests/RunCMake/CMakePresets/main.c @@ -0,0 +1,4 @@ +int main(void) +{ + return 0; +} |