diff options
Diffstat (limited to 'Tests/RunCMake/CMakePresets')
18 files changed, 118 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakePresets/ExplicitNoTrace.cmake b/Tests/RunCMake/CMakePresets/ExplicitNoTrace.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/ExplicitNoTrace.cmake diff --git a/Tests/RunCMake/CMakePresets/NoTrace.cmake b/Tests/RunCMake/CMakePresets/NoTrace.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/NoTrace.cmake diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake index efa838e..d67e8b1 100644 --- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake @@ -150,6 +150,7 @@ run_cmake_presets(InvalidRegex) set(CMakePresets_SCHEMA_EXPECTED_RESULT 1) run_cmake_presets(ConditionFuture) run_cmake_presets(SubConditionNull) +run_cmake_presets(TraceNotSupported) # Test cmakeMinimumRequired field run_cmake_presets(MinimumRequiredInvalid) @@ -326,6 +327,18 @@ set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/Debug.json.in") run_cmake_presets(NoDebug) run_cmake_presets(Debug) +# Test trace +set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/Trace.json.in") +run_cmake_presets(NoTrace) +run_cmake_presets(ExplicitNoTrace) +run_cmake_presets(Trace) +run_cmake_presets(TraceExpand) +run_cmake_presets(TraceFormatJSON) +run_cmake_presets(TraceFormatHuman) +run_cmake_presets(TraceSource) +run_cmake_presets(TraceRedirect) +run_cmake_presets(TraceAll) + # Test ${hostSystemName} macro set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/HostSystemName.json.in") run_cmake_presets(HostSystemName) diff --git a/Tests/RunCMake/CMakePresets/Trace-stderr.txt b/Tests/RunCMake/CMakePresets/Trace-stderr.txt new file mode 100644 index 0000000..5ed769c --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Trace-stderr.txt @@ -0,0 +1,4 @@ +^[^ +]*/Tests/RunCMake/CMakePresets/Trace/CMakeLists.txt\(1\): cmake_minimum_required\(VERSION 3.18 \) +[^ +]*/Tests/RunCMake/CMakePresets/Trace/CMakeLists.txt\(2\): project\(\${RunCMake_TEST} NONE \) diff --git a/Tests/RunCMake/CMakePresets/Trace.cmake b/Tests/RunCMake/CMakePresets/Trace.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Trace.cmake diff --git a/Tests/RunCMake/CMakePresets/Trace.json.in b/Tests/RunCMake/CMakePresets/Trace.json.in new file mode 100644 index 0000000..f50a6f2 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Trace.json.in @@ -0,0 +1,69 @@ +{ + "version": 7, + "configurePresets": [ + { + "name": "NoTrace", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + }, + { + "name": "ExplicitNoTrace", + "inherits": "NoTrace", + "trace": { + "mode": "off" + } + }, + { + "name": "Trace", + "inherits": "NoTrace", + "trace": { + "mode": "on" + } + }, + { + "name": "TraceExpand", + "inherits": "NoTrace", + "trace": { + "mode": "expand" + } + }, + { + "name": "TraceFormatJSON", + "inherits": "NoTrace", + "trace": { + "format": "json-v1" + } + }, + { + "name": "TraceFormatHuman", + "inherits": "NoTrace", + "trace": { + "format": "human" + } + }, + { + "name": "TraceSource", + "inherits": "NoTrace", + "trace": { + "source": "TraceSourceFile.txt" + } + }, + { + "name": "TraceRedirect", + "inherits": "NoTrace", + "trace": { + "redirect": "TraceRedirectFile.txt" + } + }, + { + "name": "TraceAll", + "inherits": "NoTrace", + "trace": { + "mode": "expand", + "format": "json-v1", + "source": "TraceSourceFile.txt", + "redirect": "TraceRedirectFile.json" + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/TraceAll.cmake b/Tests/RunCMake/CMakePresets/TraceAll.cmake new file mode 100644 index 0000000..9896ec0 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TraceAll.cmake @@ -0,0 +1,4 @@ +include(${CMAKE_CURRENT_LIST_DIR}/TraceExpand.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/TraceFormatJSON.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/TraceSource.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/TraceRedirect.cmake) diff --git a/Tests/RunCMake/CMakePresets/TraceExpand-stderr.txt b/Tests/RunCMake/CMakePresets/TraceExpand-stderr.txt new file mode 100644 index 0000000..7ee4fea --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TraceExpand-stderr.txt @@ -0,0 +1,4 @@ +^[^ +]*/Tests/RunCMake/CMakePresets/TraceExpand/CMakeLists.txt\(1\): cmake_minimum_required\(VERSION 3.18 \) +[^ +]*/Tests/RunCMake/CMakePresets/TraceExpand/CMakeLists.txt\(2\): project\(TraceExpand NONE \) diff --git a/Tests/RunCMake/CMakePresets/TraceExpand.cmake b/Tests/RunCMake/CMakePresets/TraceExpand.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TraceExpand.cmake diff --git a/Tests/RunCMake/CMakePresets/TraceFormatHuman-stderr.txt b/Tests/RunCMake/CMakePresets/TraceFormatHuman-stderr.txt new file mode 100644 index 0000000..1d3450d --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TraceFormatHuman-stderr.txt @@ -0,0 +1,4 @@ +^[^ +]*/Tests/RunCMake/CMakePresets/TraceFormatHuman/CMakeLists.txt\(1\): cmake_minimum_required\(VERSION 3.18 \) +[^ +]*/Tests/RunCMake/CMakePresets/TraceFormatHuman/CMakeLists.txt\(2\): project\(\${RunCMake_TEST} NONE \) diff --git a/Tests/RunCMake/CMakePresets/TraceFormatHuman.cmake b/Tests/RunCMake/CMakePresets/TraceFormatHuman.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TraceFormatHuman.cmake diff --git a/Tests/RunCMake/CMakePresets/TraceFormatJSON-stderr.txt b/Tests/RunCMake/CMakePresets/TraceFormatJSON-stderr.txt new file mode 100644 index 0000000..edf044c --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TraceFormatJSON-stderr.txt @@ -0,0 +1,3 @@ +^{"version":{"major":1,"minor":2}} +{"args":\["VERSION","3\.18"\],"cmd":"cmake_minimum_required","file":"[^"]*/Tests/RunCMake/CMakePresets/TraceFormatJSON/CMakeLists\.txt","frame":1,"global_frame":1,"line":1,"time":[0-9.]+} +{"args":\["\${RunCMake_TEST}","NONE"\],"cmd":"project","file":"[^"]*/Tests/RunCMake/CMakePresets/TraceFormatJSON/CMakeLists\.txt","frame":1,"global_frame":1,"line":2,"time":[0-9.]+} diff --git a/Tests/RunCMake/CMakePresets/TraceFormatJSON.cmake b/Tests/RunCMake/CMakePresets/TraceFormatJSON.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TraceFormatJSON.cmake diff --git a/Tests/RunCMake/CMakePresets/TraceNotSupported-result.txt b/Tests/RunCMake/CMakePresets/TraceNotSupported-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TraceNotSupported-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/TraceNotSupported-stderr.txt b/Tests/RunCMake/CMakePresets/TraceNotSupported-stderr.txt new file mode 100644 index 0000000..de19a8c --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TraceNotSupported-stderr.txt @@ -0,0 +1,3 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/TraceNotSupported: +File version must be 7 or higher for trace preset support$ diff --git a/Tests/RunCMake/CMakePresets/TraceNotSupported.json.in b/Tests/RunCMake/CMakePresets/TraceNotSupported.json.in new file mode 100644 index 0000000..f3d3fbd --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TraceNotSupported.json.in @@ -0,0 +1,13 @@ +{ + "version": 6, + "configurePresets": [ + { + "name": "TraceNotSupported", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build", + "trace": { + "mode": "expand" + } + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/TraceRedirect.cmake b/Tests/RunCMake/CMakePresets/TraceRedirect.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TraceRedirect.cmake diff --git a/Tests/RunCMake/CMakePresets/TraceSource.cmake b/Tests/RunCMake/CMakePresets/TraceSource.cmake new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/CMakePresets/TraceSource.cmake |