diff options
Diffstat (limited to 'Tests/RunCMake/CMakePresets/validate_schema.py')
-rw-r--r-- | Tests/RunCMake/CMakePresets/validate_schema.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakePresets/validate_schema.py b/Tests/RunCMake/CMakePresets/validate_schema.py new file mode 100644 index 0000000..c9f84ee --- /dev/null +++ b/Tests/RunCMake/CMakePresets/validate_schema.py @@ -0,0 +1,17 @@ +import jsmin +import json +import jsonschema +import os.path +import sys + + +with open(sys.argv[1], "rb") as f: + contents = json.loads(jsmin.jsmin(f.read().decode("utf-8-sig"))) + +schema_file = os.path.join( + os.path.dirname(__file__), + "..", "..", "..", "Help", "manual", "presets", "schema.json") +with open(schema_file) as f: + schema = json.load(f) + +jsonschema.validate(contents, schema) |