diff options
Diffstat (limited to 'Tests')
10 files changed, 66 insertions, 2 deletions
diff --git a/Tests/RunCMake/CMakePresetsTest/Good-test-outputJUnit-check.cmake b/Tests/RunCMake/CMakePresetsTest/Good-test-outputJUnit-check.cmake new file mode 100644 index 0000000..e1788cb --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/Good-test-outputJUnit-check.cmake @@ -0,0 +1,4 @@ +include("${CMAKE_CURRENT_LIST_DIR}/check.cmake") +if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/default/output.xml") + string(APPEND RunCMake_TEST_FAILED "Expected ${RunCMake_TEST_BINARY_DIR}/default/output.xml to exist but it does not\n") +endif() diff --git a/Tests/RunCMake/CMakePresetsTest/Good-test-outputLog-check.cmake b/Tests/RunCMake/CMakePresetsTest/Good-test-outputLog-check.cmake new file mode 100644 index 0000000..e860d42 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/Good-test-outputLog-check.cmake @@ -0,0 +1,4 @@ +include("${CMAKE_CURRENT_LIST_DIR}/check.cmake") +if(NOT EXISTS "${RunCMake_TEST_BINARY_DIR}/default/output.log") + string(APPEND RunCMake_TEST_FAILED "Expected ${RunCMake_TEST_BINARY_DIR}/default/output.log to exist but it does not\n") +endif() diff --git a/Tests/RunCMake/CMakePresetsTest/Good.json.in b/Tests/RunCMake/CMakePresetsTest/Good.json.in index d484a19..a4b875a 100644 --- a/Tests/RunCMake/CMakePresetsTest/Good.json.in +++ b/Tests/RunCMake/CMakePresetsTest/Good.json.in @@ -1,5 +1,5 @@ { - "version": 5, + "version": 6, "configurePresets": [ { "name": "default", @@ -171,6 +171,20 @@ "execution": { "showOnly": "human" } + }, + { + "name": "outputLog", + "inherits": "minimal", + "output": { + "outputLogFile": "${sourceDir}/build/default/output.log" + } + }, + { + "name": "outputJUnit", + "inherits": "minimal", + "output": { + "outputJUnitFile": "${sourceDir}/build/default/output.xml" + } } ] } diff --git a/Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported-test-x-result.txt b/Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported-test-x-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported-test-x-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported-test-x-stderr.txt b/Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported-test-x-stderr.txt new file mode 100644 index 0000000..acd5785 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported-test-x-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported: File version must be 6 or higher for CTest JUnit output support$ diff --git a/Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported.json.in b/Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported.json.in new file mode 100644 index 0000000..93f6b0c --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/OutputJUnitUnsupported.json.in @@ -0,0 +1,17 @@ +{ + "version": 5, + "configurePresets": [ + { + "name": "default" + } + ], + "testPresets": [ + { + "name": "unsupported", + "configurePreset": "default", + "output": { + "outputJUnitFile": "junit.xml" + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake index bec0dd94..1c7b836 100644 --- a/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresetsTest/RunCMakeTest.cmake @@ -78,7 +78,7 @@ set(CMakePresetsTest_ASSETS "Good-indexFile.txt") set(GoodTestPresets "minimal;defaults;noEnvironment;withEnvironment" "config-debug;config-release" - "exclude;index;indexFile;showOnly") + "exclude;index;indexFile;showOnly;outputLog;outputJUnit") run_cmake_test_presets(Good "default" "" @@ -105,6 +105,8 @@ run_cmake_test_presets(Invalid "" "" "hidden;vendorMacro") set(CMakePresets_SCHEMA_EXPECTED_RESULT 1) run_cmake_test_presets(PresetsUnsupported "" "" "x") run_cmake_test_presets(ConditionFuture "" "" "x") +run_cmake_test_presets(TestOutputTruncationUnsupported "" "" "x") +run_cmake_test_presets(OutputJUnitUnsupported "" "" "x") set(CMakePresets_SCHEMA_EXPECTED_RESULT 0) run_cmake_test_presets(ConfigurePresetUnreachable "" "" "x") set(CMakePresetsTest_NO_CONFIGURE 0) diff --git a/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-result.txt b/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-stderr.txt b/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-stderr.txt new file mode 100644 index 0000000..90ea7c3 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported-test-x-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported: File version must be 5 or higher for testOutputTruncation preset support\.$ diff --git a/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported.json.in b/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported.json.in new file mode 100644 index 0000000..c116039 --- /dev/null +++ b/Tests/RunCMake/CMakePresetsTest/TestOutputTruncationUnsupported.json.in @@ -0,0 +1,17 @@ +{ + "version": 4, + "configurePresets": [ + { + "name": "default" + } + ], + "testPresets": [ + { + "name": "default", + "configurePreset": "default", + "output": { + "testOutputTruncation": "tail" + } + } + ] +} |