f4e6e2e787df2d5bca49c6cd1967a5243267fb28
[babeltrace.git] / tests / plugins / flt.lttng-utils.debug-info / test_lttng_utils_debug_info.py
1 import unittest
2 import os.path
3 import bt2
4 import os
5
6
7 @unittest.skip('depends on Python bindings, which are broken')
8 class LttngUtilsDebugInfoTestCase(unittest.TestCase):
9 def test_debug_info(self):
10 debug_info_data_path = os.environ['BT_DEBUG_INFO_PATH']
11 trace_path = os.path.join(debug_info_data_path, 'trace')
12 target_prefix = os.path.join(debug_info_data_path, '..', '..')
13 src = bt2.ComponentSpec('ctf', 'fs', trace_path)
14 flt = bt2.ComponentSpec('lttng-utils', 'debug-info', {
15 'target-prefix': target_prefix,
16 })
17 it = bt2.TraceCollectionNotificationIterator(src, flt,
18 [bt2.EventNotification])
19 notifs = list(it)
20 debug_info = notifs[2].event['debug_info']
21 self.assertEqual(debug_info['bin'], 'libhello_so+0x14d4')
22 self.assertEqual(debug_info['func'], 'foo+0xa9')
23 self.assertEqual(debug_info['src'], 'libhello.c:7')
24 debug_info = notifs[3].event['debug_info']
25 self.assertEqual(debug_info['bin'], 'libhello_so+0x15a6')
26 self.assertEqual(debug_info['func'], 'bar+0xa9')
27 self.assertEqual(debug_info['src'], 'libhello.c:13')
This page took 0.030129 seconds and 3 git commands to generate.