summaryrefslogtreecommitdiffstats
path: root/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py')
-rw-r--r--scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py b/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py
index 6f46a1c03d..0ff645a170 100644
--- a/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py
+++ b/scripts/pybootchartgui/pybootchartgui/tests/process_tree_test.py
@@ -20,7 +20,9 @@ class TestProcessTree(unittest.TestCase):
parser = main._mk_options_parser()
options, args = parser.parse_args(['--q', self.rootdir])
writer = main._mk_writer(options)
+ self.writer = writer
trace = parsing.Trace(writer, args, options)
+ self.trace = trace
parsing.parse_file(writer, trace, self.mk_fname('proc_ps.log'))
trace.compile(writer)
@@ -58,6 +60,17 @@ class TestProcessTree(unittest.TestCase):
process_tree = self.processtree.process_tree
self.checkAgainstJavaExtract(self.mk_fname('extract.processtree.2.log'), process_tree)
+ def test_merge_logger(self):
+ proc_ps_path = os.path.join(os.path.dirname(sys.argv[0]), 'test_data/process_tree/proc_ps.log')
+ trace = self.trace
+ writer = self.writer
+ parsing.parse_file(writer, trace, proc_ps_path)
+ trace.compile(writer)
+ processtree = process_tree.ProcessTree(writer, None, trace.ps_stats, \
+ trace.ps_stats.sample_period, None, False, None, None, False, for_testing=True)
+ removed = processtree.merge_logger(processtree.process_tree, 'bootchartd', None, False)
+ self.assertNotEqual(removed, 0)
+
def testPrune(self):
self.processtree.merge_logger(self.processtree.process_tree, 'bootchartd', None, False)
self.processtree.prune(self.processtree.process_tree, None)