diff options
author | Brad King <brad.king@kitware.com> | 2020-01-24 14:19:46 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-01-24 14:19:55 (GMT) |
commit | 816bbf227f8cbfb37115af5ea93be436ab8f2059 (patch) | |
tree | 34bf15f34815e904fc426bf6f5eda0e28403e4f6 /Tests | |
parent | 89a93348d514ff8c4233d8e25ebe2ff65e26c446 (diff) | |
parent | c829f0cfcaa4753743fde1900091e1233c41350b (diff) | |
download | CMake-816bbf227f8cbfb37115af5ea93be436ab8f2059.zip CMake-816bbf227f8cbfb37115af5ea93be436ab8f2059.tar.gz CMake-816bbf227f8cbfb37115af5ea93be436ab8f2059.tar.bz2 |
Merge topic 'trace_json_timestamp'
c829f0cfca trace: Add time and stack level to JSON output format
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Volo Zyko <volo.zyko@gmail.com>
Merge-request: !4242
Diffstat (limited to 'Tests')
-rwxr-xr-x | Tests/RunCMake/CommandLine/trace-json-v1-check.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/Tests/RunCMake/CommandLine/trace-json-v1-check.py b/Tests/RunCMake/CommandLine/trace-json-v1-check.py index 14febaf..e617b76 100755 --- a/Tests/RunCMake/CommandLine/trace-json-v1-check.py +++ b/Tests/RunCMake/CommandLine/trace-json-v1-check.py @@ -46,6 +46,7 @@ required_traces = [ { 'args': msg_args, 'cmd': 'message', + 'frame': 3 if expand else 2 }, ] @@ -59,14 +60,17 @@ with open(trace_file, 'r') as fp: for i in fp.readlines(): line = json.loads(i) - assert sorted(line.keys()) == ['args', 'cmd', 'file', 'line'] + assert sorted(line.keys()) == ['args', 'cmd', 'file', 'frame', 'line', 'time'] assert isinstance(line['args'], list) assert isinstance(line['cmd'], unicode) assert isinstance(line['file'], unicode) + assert isinstance(line['frame'], int) assert isinstance(line['line'], int) + assert isinstance(line['time'], float) for j in required_traces: - if j['cmd'] == line['cmd'] and j['args'] == line['args']: - j['found'] = True + # Compare the subset of required keys with line + if {k: line[k] for k in j} == j: + required_traces.remove(j) -assert all([x.get('found', False) == True for x in required_traces]) +assert not required_traces |