test_breakpoint_fileline.py revision a3c6f62775506c95afd556e617f14d7a28839f01
1a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond'''Module that contains the test TestBreakpointFileLine.'''
2dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo
3a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummondfrom __future__ import absolute_import
4dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo
5a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummondfrom harness.test_base_remote import TestBaseRemote
6a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummondfrom harness.decorators import (
7a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond    cpp_only_test,
8a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond    ordered_test
9a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond)
10dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo
11dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo
12a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummondclass TestBreakpointFileLine(TestBaseRemote):
13a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond    '''Tests the setting of a breakpoint on a specific line of a RS file.'''
14dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo
15a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond    bundle_target = {
16a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond        'java': 'JavaDebugWaitAttach',
17a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond        'jni': 'JNIDebugWaitAttach',
18a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond        'cpp': 'CppDebugWaitAttach'
19a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond    }
20dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo
21a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond    @ordered_test(0)
22a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond    def test_breakpoint_fileline(self):
23dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo        self.try_command('language renderscript status',
24dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo                         ['Runtime Library discovered',
25dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo                          'Runtime Driver discovered'])
26dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo
27dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo        self.try_command('breakpoint set --file simple.rs --line 12',
28dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo                         ['(pending)'])
29dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo
30dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo        self.try_command('process continue',
31dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo                         [])
32dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo
33dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo        self.try_command('bt',
34dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo                         ['librs.simple.so',
35dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo                          'simple_kernel',
36dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo                          'stop reason = breakpoint'])
37dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo
38dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo        self.try_command('breakpoint list',
39dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo                         ['simple.rs',
40dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo                          'resolved = 1'])
41dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo
42dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo        self.try_command('process status',
43dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo                         ['stopped',
44dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo                          'stop reason = breakpoint'])
45dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo
46dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo        self.try_command('breakpoint delete 1',
47dcecc0c8d22e894525e25a122ce25129b51338f2Dean De Leo                         ['1 breakpoints deleted'])
48a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond
49a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond    @ordered_test('last')
50a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond    @cpp_only_test()
51a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond    def test_cpp_cleanup(self):
52a3c6f62775506c95afd556e617f14d7a28839f01Luke Drummond        self.try_command('process continue', ['exited with status = 0'])
53