mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-26 16:18:43 -05:00
2e7bca5f05
Add schema validation to the existing test case for --show-only=json-v1 too. Fixes: #26980
17 lines
393 B
Python
17 lines
393 B
Python
import json
|
|
import jsonschema
|
|
import os.path
|
|
import sys
|
|
|
|
|
|
with open(sys.argv[1], "r", encoding="utf-8-sig") as f:
|
|
contents = json.load(f)
|
|
|
|
schema_file = os.path.join(
|
|
os.path.dirname(__file__),
|
|
"..", "..", "..", "Help", "manual", "ctest", "show-only-schema.json")
|
|
with open(schema_file, "r", encoding="utf-8") as f:
|
|
schema = json.load(f)
|
|
|
|
jsonschema.validate(contents, schema)
|