summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/CTestCommandLine/show_only_json_check.py
blob: 493c9e579db41a57794307741dce0601961694a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import sys
import json
import re

def is_bool(x):
    return isinstance(x, bool)

def is_dict(x):
    return isinstance(x, dict)

def is_list(x):
    return isinstance(x, list)

def is_int(x):
    return isinstance(x, int) or isinstance(x, long)

def is_string(x):
    return isinstance(x, str) or isinstance(x, unicode)

def check_re(x, regex):
    assert re.search(regex, x)

with open(sys.argv[1]) as f:
    ctest_json = json.load(f)