+success = True
+tests = [
+ {
+ "description": "Test user space constructor/destructor instrumentation coverage (C++ w/ static archive)",
+ "application": "gen-ust-events-constructor/gen-ust-events-constructor-a",
+ "expected_events": copy.deepcopy(expected_events_common + expected_events_tp_a),
+ "skip_if_application_not_present": False,
+ },
+ {
+ "description": "Test user space constructor/destructor instrumentation coverage (C++ w/ dynamic object",
+ "application": "gen-ust-events-constructor/gen-ust-events-constructor-so",
+ "expected_events": copy.deepcopy(
+ expected_events_common + expected_events_tp_so
+ ),
+ # This application is not be built when `NO_SHARED` is set in the
+ # configuration options.
+ "skip_if_application_not_present": True,
+ },
+]
+
+success = True
+for test in tests:
+ tap = lttngtest.TapGenerator(7 + len(test["expected_events"]))
+ with lttngtest.test_environment(with_sessiond=True, log=tap.diagnostic) as test_env:
+ try:
+ outputlocation = capture_trace(
+ tap, test_env, test["application"], test["description"]
+ )
+ except FileNotFoundError as fne:
+ tap.diagnostic(fne)
+ if test["skip_if_application_not_present"]:
+ tap.skip(
+ "Test application '{}' not found".format(test["application"]),
+ tap.remaining_test_cases,
+ )
+ break
+ # Warning: validate_trace mutates test['expected_events']
+ validate_trace(outputlocation.path, tap, test["expected_events"])
+ success = success and tap.is_successful