test_breakpoint_fileline.py revision dcecc0c8d22e894525e25a122ce25129b51338f2
1'''Module that contains the test TestBreakpointFileLine.'''
2
3from harness.test_base_remote import TestBaseRemote
4
5
6class TestBreakpointFileLine(TestBaseRemote):
7    '''Tests the setting of a breakpoint on a specific line of a RS file.'''
8
9    def get_bundle_target(self):
10        '''Return string with name of bundle executable to run.
11
12        Returns:
13            A string containing the name of the binary that this test can be run
14            with.
15        '''
16        return 'JavaDebugWaitAttach'
17
18    def test_case(self, _):
19        '''Run the lldb commands that are being tested.
20
21        Raises:
22            TestFail: One of the lldb commands did not provide the expected
23                      output.
24        '''
25        self.try_command('language renderscript status',
26                         ['Runtime Library discovered',
27                          'Runtime Driver discovered'])
28
29        self.try_command('breakpoint set --file simple.rs --line 12',
30                         ['(pending)'])
31
32        self.try_command('process continue',
33                         [])
34
35        self.try_command('bt',
36                         ['librs.simple.so',
37                          'simple_kernel',
38                          'stop reason = breakpoint'])
39
40        self.try_command('breakpoint list',
41                         ['simple.rs',
42                          'resolved = 1'])
43
44        self.try_command('process status',
45                         ['stopped',
46                          'stop reason = breakpoint'])
47
48        self.try_command(
49            'language renderscript kernel breakpoint set simple_kernel',
50            ['where = librs.simple.so`simple_kernel',
51             'Breakpoint(s) created'])
52
53        self.try_command('breakpoint list',
54                         [])
55