summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CMakePresets/check.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/RunCMake/CMakePresets/check.cmake')
-rw-r--r--Tests/RunCMake/CMakePresets/check.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakePresets/check.cmake b/Tests/RunCMake/CMakePresets/check.cmake
new file mode 100644
index 0000000..bf43c7e
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/check.cmake
@@ -0,0 +1,15 @@
+if(PYTHON_EXECUTABLE AND CMake_TEST_JSON_SCHEMA)
+ if(NOT CMakePresets_SCHEMA_EXPECTED_RESULT)
+ set(CMakePresets_SCHEMA_EXPECTED_RESULT 0)
+ endif()
+ if(EXISTS "${RunCMake_TEST_SOURCE_DIR}/CMakePresets.json")
+ validate_schema("${RunCMake_TEST_SOURCE_DIR}/CMakePresets.json" "${CMakePresets_SCHEMA_EXPECTED_RESULT}")
+ endif()
+
+ if(NOT CMakeUserPresets_SCHEMA_EXPECTED_RESULT)
+ set(CMakeUserPresets_SCHEMA_EXPECTED_RESULT 0)
+ endif()
+ if(EXISTS "${RunCMake_TEST_SOURCE_DIR}/CMakeUserPresets.json")
+ validate_schema("${RunCMake_TEST_SOURCE_DIR}/CMakeUserPresets.json" "${CMakeUserPresets_SCHEMA_EXPECTED_RESULT}")
+ endif()
+endif()