summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2020-02-07 15:58:10 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2020-02-07 15:58:10 (GMT)
commit1605fcbbd95319cc744ec17e49069e01ed681617 (patch)
treed1c0037b85f960e38c906f370224057c8981cfb0
parent3844e2ae4c9a35992917beb0edd1795a436169bf (diff)
downloadCMake-1605fcbbd95319cc744ec17e49069e01ed681617.zip
CMake-1605fcbbd95319cc744ec17e49069e01ed681617.tar.gz
CMake-1605fcbbd95319cc744ec17e49069e01ed681617.tar.bz2
FileAPI test: Add infrastructure for reading JSON test data
-rw-r--r--Tests/RunCMake/FileAPI/codemodel-v2-check.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Tests/RunCMake/FileAPI/codemodel-v2-check.py b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
index de6253f..00a0e9d 100644
--- a/Tests/RunCMake/FileAPI/codemodel-v2-check.py
+++ b/Tests/RunCMake/FileAPI/codemodel-v2-check.py
@@ -1,8 +1,14 @@
from check_index import *
+import json
import sys
import os
+def read_codemodel_json_data(filename):
+ abs_filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), "codemodel-v2-data", filename)
+ with open(abs_filename, "r") as f:
+ return json.load(f)
+
def check_objects(o, g):
assert is_list(o)
assert len(o) == 1