1# Copyright (C) 2016 The Android Open Source Project 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15'''Module that contains the test TestBreakpointFileLine.''' 16 17from __future__ import absolute_import 18 19from harness.test_base_remote import TestBaseRemote 20from harness.decorators import ( 21 cpp_only_test, 22 ordered_test 23) 24 25 26class TestBreakpointFileLine(TestBaseRemote): 27 '''Tests the setting of a breakpoint on a specific line of a RS file.''' 28 29 bundle_target = { 30 'java': 'JavaDebugWaitAttach', 31 'jni': 'JNIDebugWaitAttach', 32 'cpp': 'CppDebugWaitAttach' 33 } 34 35 @ordered_test(0) 36 def test_breakpoint_fileline(self): 37 self.try_command('language renderscript status', 38 ['Runtime Library discovered', 39 'Runtime Driver discovered']) 40 41 self.try_command('breakpoint set --file simple.rs --line 28', 42 ['(pending)']) 43 44 self.try_command('process continue', 45 []) 46 47 self.try_command('bt', 48 ['librs.simple.so', 49 'simple_kernel', 50 'stop reason = breakpoint']) 51 52 self.try_command('breakpoint list', 53 ['simple.rs', 54 'resolved = 1']) 55 56 self.try_command('process status', 57 ['stopped', 58 'stop reason = breakpoint']) 59 60 self.try_command('breakpoint delete 1', 61 ['1 breakpoints deleted']) 62 63 @ordered_test('last') 64 @cpp_only_test() 65 def test_cpp_cleanup(self): 66 self.try_command('process continue', ['exited with status = 0']) 67