summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-02-09 14:04:36 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-02-09 14:04:43 (GMT)
commit3d5466d5e95869380b38e40f8431a19e8a6d458e (patch)
treed95c4e980702e0552e7ddf560f392995f17b0dbb /Tests
parent25003baf50fa31f331fd2abef74dcb41b9db2c06 (diff)
parenta41d6e4d7a264954bebd6c1c45475647da60e14c (diff)
downloadCMake-3d5466d5e95869380b38e40f8431a19e8a6d458e.zip
CMake-3d5466d5e95869380b38e40f8431a19e8a6d458e.tar.gz
CMake-3d5466d5e95869380b38e40f8431a19e8a6d458e.tar.bz2
Merge topic 'trace-global-frame'
a41d6e4d7a Trace: add global_frame field to json-v1 format Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Merge-request: !6954
Diffstat (limited to 'Tests')
-rwxr-xr-xTests/RunCMake/CommandLine/trace-json-v1-check.py14
-rw-r--r--Tests/RunCMake/CommandLine/trace-json-v1-nested/CMakeLists.txt9
-rw-r--r--Tests/RunCMake/CommandLine/trace-json-v1.cmake1
-rw-r--r--Tests/RunCMake/cmake_language/defer_call_trace_json-stderr.txt6
4 files changed, 24 insertions, 6 deletions
diff --git a/Tests/RunCMake/CommandLine/trace-json-v1-check.py b/Tests/RunCMake/CommandLine/trace-json-v1-check.py
index 1ee005e..995cfad 100755
--- a/Tests/RunCMake/CommandLine/trace-json-v1-check.py
+++ b/Tests/RunCMake/CommandLine/trace-json-v1-check.py
@@ -46,8 +46,15 @@ required_traces = [
{
'args': msg_args,
'cmd': 'message',
- 'frame': 3 if expand else 2
+ 'frame': 3 if expand else 2,
+ 'global_frame': 3 if expand else 2
},
+ {
+ 'args': ['STATUS', 'nested global_frame'],
+ 'cmd': 'message',
+ 'frame': 3,
+ 'global_frame': 6 if expand else 5
+ }
]
with open(trace_file, 'r') as fp:
@@ -56,15 +63,16 @@ with open(trace_file, 'r') as fp:
assert sorted(vers.keys()) == ['version']
assert sorted(vers['version'].keys()) == ['major', 'minor']
assert vers['version']['major'] == 1
- assert vers['version']['minor'] == 1
+ assert vers['version']['minor'] == 2
for i in fp.readlines():
line = json.loads(i)
- assert sorted(line.keys()) == ['args', 'cmd', 'file', 'frame', 'line', 'time']
+ assert sorted(line.keys()) == ['args', 'cmd', 'file', 'frame', 'global_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['global_frame'], int)
assert isinstance(line['line'], int)
assert isinstance(line['time'], float)
diff --git a/Tests/RunCMake/CommandLine/trace-json-v1-nested/CMakeLists.txt b/Tests/RunCMake/CommandLine/trace-json-v1-nested/CMakeLists.txt
new file mode 100644
index 0000000..089a960
--- /dev/null
+++ b/Tests/RunCMake/CommandLine/trace-json-v1-nested/CMakeLists.txt
@@ -0,0 +1,9 @@
+function(f)
+ message(STATUS "nested global_frame")
+endfunction()
+
+function(g)
+ f()
+endfunction()
+
+g()
diff --git a/Tests/RunCMake/CommandLine/trace-json-v1.cmake b/Tests/RunCMake/CommandLine/trace-json-v1.cmake
index ed0a0f9..871746d 100644
--- a/Tests/RunCMake/CommandLine/trace-json-v1.cmake
+++ b/Tests/RunCMake/CommandLine/trace-json-v1.cmake
@@ -3,3 +3,4 @@ set(ASDF fff sss " SPACES !!! ")
set(FOO 42)
set(BAR " space in string!")
message(STATUS fff ${ASDF} " ${FOO} ${BAR}" " SPACES !!! ")
+add_subdirectory(trace-json-v1-nested)
diff --git a/Tests/RunCMake/cmake_language/defer_call_trace_json-stderr.txt b/Tests/RunCMake/cmake_language/defer_call_trace_json-stderr.txt
index 647beb0..3bde16d 100644
--- a/Tests/RunCMake/cmake_language/defer_call_trace_json-stderr.txt
+++ b/Tests/RunCMake/cmake_language/defer_call_trace_json-stderr.txt
@@ -1,5 +1,5 @@
-{"args":\["DEFER","CALL","message","Deferred Message"\],"cmd":"cmake_language","file":"[^"]*/Tests/RunCMake/cmake_language/defer_call_trace_json.cmake","frame":2,"line":2,"time":[0-9.]+}
-{"args":\["Immediate Message"\],"cmd":"message","file":"[^"]*/Tests/RunCMake/cmake_language/defer_call_trace_json.cmake","frame":2,"line":3,"time":[0-9.]+}
+{"args":\["DEFER","CALL","message","Deferred Message"\],"cmd":"cmake_language","file":"[^"]*/Tests/RunCMake/cmake_language/defer_call_trace_json.cmake","frame":2,"global_frame":2,"line":2,"time":[0-9.]+}
+{"args":\["Immediate Message"\],"cmd":"message","file":"[^"]*/Tests/RunCMake/cmake_language/defer_call_trace_json.cmake","frame":2,"global_frame":2,"line":3,"time":[0-9.]+}
Immediate Message
-{"args":\["Deferred Message"],"cmd":"message","defer":"__0","file":"[^"]*/Tests/RunCMake/cmake_language/defer_call_trace_json.cmake","frame":1,"line":2,"time":[0-9.]+}
+{"args":\["Deferred Message"],"cmd":"message","defer":"__0","file":"[^"]*/Tests/RunCMake/cmake_language/defer_call_trace_json.cmake","frame":1,"global_frame":1,"line":2,"time":[0-9.]+}
Deferred Message$