diff --git a/tracetools_launch/test/tracetools_launch/test_trace_action.py b/tracetools_launch/test/tracetools_launch/test_trace_action.py index 9f27407..626a531 100644 --- a/tracetools_launch/test/tracetools_launch/test_trace_action.py +++ b/tracetools_launch/test/tracetools_launch/test_trace_action.py @@ -15,6 +15,7 @@ import unittest from tracetools_launch.action import Trace +from tracetools_launch.actions.ld_preload import LdPreload class TestTraceAction(unittest.TestCase): @@ -48,9 +49,34 @@ class TestTraceAction(unittest.TestCase): for events in events_lists_no_match: self.assertFalse(Trace.has_profiling_events(events)) + def test_has_ust_memory_events(self) -> None: + events_lists_match = [ + [ + 'hashtag:yopo', + 'lttng_ust_libc:malloc', + 'lttng_ust_libc:realloc', + ], + [ + 'lttng_ust_libc:still_a_match', + ], + ] + events_lists_no_match = [ + [], + [ + 'my_random:event', + 'lttng_ust_whatever' + ] + ] + for events in events_lists_match: + self.assertTrue(Trace.has_ust_memory_events(events)) + for events in events_lists_no_match: + self.assertFalse(Trace.has_ust_memory_events(events)) + def test_get_shared_lib_path(self) -> None: # Only test not finding a lib for now - self.assertIsNone(Trace.get_shared_lib_path('random_lib_that_does_not_exist_I_hope.so')) + self.assertIsNone( + LdPreload.get_shared_lib_path('random_lib_that_does_not_exist_I_hope.so') + ) if __name__ == '__main__':