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 TestInvokeFun.''' 16 17from __future__ import absolute_import 18 19from harness.test_base_remote import TestBaseRemote 20from harness.decorators import ( 21 ordered_test, 22 cpp_only_test 23) 24 25 26class TestInvokeFun(TestBaseRemote): 27 '''Tests debugging a function executed from Java using invoke_*.''' 28 29 bundle_target = { 30 'java': 'BranchingFunCalls', 31 'jni': 'JNIBranchingFunCalls', 32 'cpp': 'CppBranchingFunCalls' 33 } 34 35 def test_invoke_fun(self): 36 # pylint: disable=line-too-long 37 self.try_command('language renderscript status', 38 ['Runtime Library discovered', 39 'Runtime Driver discovered']) 40 41 self.try_command('breakpoint set --name addToGlobal', 42 ['Breakpoint 1', '(pending)']) 43 44 self.try_command('process continue', 45 ['stopped', 46 'stop reason = breakpoint'], 47 [r'scalars\.rs:7[345]']) 48 49 self.try_command('language renderscript kernel breakpoint set simple_kernel', 50 ['Breakpoint 2', 'Breakpoint(s) created']) 51 52 self.try_command('process continue', 53 ['stopped', 54 'stop reason = breakpoint', 55 'simple_kernel'], 56 [r'scalars\.rs:6[123]']) 57 58 self.try_command('expr glob', 59 ['(int)', 60 '357']) 61 62 @ordered_test('last') 63 @cpp_only_test() 64 def test_cpp_cleanup(self): 65 self.try_command('breakpoint delete 1', ['1 breakpoints deleted']) 66 67 self.try_command('breakpoint delete 2', ['1 breakpoints deleted']) 68 69 self.try_command('process continue', ['exited with status = 0']) 70