3 # SPDX-FileCopyrightText: Kienan Stewart <kstewart@efficios.com>
4 # SPDX-License-Identifier: GPL-2.0-only
8 Test instrumentation coverage of C constructors and destructors by LTTng-UST
9 tracepoints with a dynamic object.
11 This test successively sets up a session, traces a test application, and then
12 reads the resulting trace to determine if all the expected events are present.
19 # Import in-tree test utils
20 test_utils_import_path
= pathlib
.Path(__file__
).absolute().parents
[3] / "utils"
21 sys
.path
.append(str(test_utils_import_path
))
24 import ust_constructor_common
as ust
27 "description": "Test user space constructor/destructor instrumentation coverage (C w/ dynamic object)",
28 "application": "gen-ust-events-constructor/gen-ust-events-c-constructor-so",
29 "expected_events": copy
.deepcopy(
30 ust
.expected_events_common
+ ust
.expected_events_tp_so
32 # This application is not be built when `NO_SHARED` is set in the
33 # configuration options.
34 "skip_if_application_not_present": True,
37 tap
= lttngtest
.TapGenerator(7 + len(test
["expected_events"]))
38 with lttngtest
.test_environment(with_sessiond
=True, log
=tap
.diagnostic
) as test_env
:
40 outputlocation
= ust
.capture_trace(
41 tap
, test_env
, test
["application"], test
["description"]
43 except FileNotFoundError
as fne
:
45 if test
["skip_if_application_not_present"]:
47 "Test application '{}' not found".format(test
["application"]),
48 tap
.remaining_test_cases
,
51 # Warning: validate_trace mutates test['expected_events']
52 ust
.validate_trace(outputlocation
.path
, tap
, test
["expected_events"])
55 sys
.exit(0 if tap
.is_successful
else 1)
This page took 0.058176 seconds and 4 git commands to generate.