diff options
author | Brad King <brad.king@kitware.com> | 2021-02-24 14:33:59 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2021-02-24 14:33:59 (GMT) |
commit | 06e16ea008bf6efbe68028279539cfc6d1ff7a93 (patch) | |
tree | 32d9e2b807f4027033b02db6a3a189cf459c0698 /Tests/RunCMake/CMakePresets | |
parent | afaa69f5b3812904177eb96dfb59a505a7e165d7 (diff) | |
parent | 431dd59b5e30000c3e3860af69c0dd387634205b (diff) | |
download | CMake-06e16ea008bf6efbe68028279539cfc6d1ff7a93.zip CMake-06e16ea008bf6efbe68028279539cfc6d1ff7a93.tar.gz CMake-06e16ea008bf6efbe68028279539cfc6d1ff7a93.tar.bz2 |
Merge branch 'backport-3.19-preset-no-comments' into preset-no-comments
Diffstat (limited to 'Tests/RunCMake/CMakePresets')
-rw-r--r-- | Tests/RunCMake/CMakePresets/CMakePresets.json.in | 4 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresets/Comment-result.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresets/Comment-stderr.txt | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresets/Comment.json.in | 11 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresets/RunCMakeTest.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMakePresets/validate_schema.py | 3 |
6 files changed, 16 insertions, 6 deletions
diff --git a/Tests/RunCMake/CMakePresets/CMakePresets.json.in b/Tests/RunCMake/CMakePresets/CMakePresets.json.in index 54e4140..e65c1a9 100644 --- a/Tests/RunCMake/CMakePresets/CMakePresets.json.in +++ b/Tests/RunCMake/CMakePresets/CMakePresets.json.in @@ -1,8 +1,4 @@ -/* - * Block comment - */ { - // Inline comment "version": 1, "cmakeMinimumRequired": { "major": 3, diff --git a/Tests/RunCMake/CMakePresets/Comment-result.txt b/Tests/RunCMake/CMakePresets/Comment-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Comment-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMakePresets/Comment-stderr.txt b/Tests/RunCMake/CMakePresets/Comment-stderr.txt new file mode 100644 index 0000000..2f404bc --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Comment-stderr.txt @@ -0,0 +1,2 @@ +^CMake Error: Could not read presets from [^ +]*/Tests/RunCMake/CMakePresets/Comment: JSON parse error$ diff --git a/Tests/RunCMake/CMakePresets/Comment.json.in b/Tests/RunCMake/CMakePresets/Comment.json.in new file mode 100644 index 0000000..0f7120c --- /dev/null +++ b/Tests/RunCMake/CMakePresets/Comment.json.in @@ -0,0 +1,11 @@ +// Comment +{ + "version": 1, + "configurePresets": [ + { + "name": "Comment", + "generator": "@RunCMake_GENERATOR@", + "binaryDir": "${sourceDir}/build" + } + ] +} diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake index 25a7f2f..1864ecd 100644 --- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake @@ -63,6 +63,7 @@ endfunction() # Test CMakePresets.json errors set(CMakePresets_SCHEMA_EXPECTED_RESULT 1) run_cmake_presets(NoCMakePresets) +run_cmake_presets(Comment) run_cmake_presets(JSONParseError) run_cmake_presets(InvalidRoot) run_cmake_presets(NoVersion) diff --git a/Tests/RunCMake/CMakePresets/validate_schema.py b/Tests/RunCMake/CMakePresets/validate_schema.py index c9f84ee..b2a67fc 100644 --- a/Tests/RunCMake/CMakePresets/validate_schema.py +++ b/Tests/RunCMake/CMakePresets/validate_schema.py @@ -1,4 +1,3 @@ -import jsmin import json import jsonschema import os.path @@ -6,7 +5,7 @@ import sys with open(sys.argv[1], "rb") as f: - contents = json.loads(jsmin.jsmin(f.read().decode("utf-8-sig"))) + contents = json.loads(f.read().decode("utf-8-sig")) schema_file = os.path.join( os.path.dirname(__file__), |