1 # -*- Python -*- 2 # 3 # Copyright (C) 2012 The Android Open Source Project 4 # 5 # Licensed under the Apache License, Version 2.0 (the "License"); 6 # you may not use this file except in compliance with the License. 7 # You may obtain a copy of the License at 8 # 9 # http://www.apache.org/licenses/LICENSE-2.0 10 # 11 # Unless required by applicable law or agreed to in writing, software 12 # distributed under the License is distributed on an "AS IS" BASIS, 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 # See the License for the specific language governing permissions and 15 # limitations under the License. 16 # 17 18 # 19 ### Configuration file for target side debugger integration tests 20 # 21 22 # Set up the suite name, extensions that are recognized as testcases, and 23 # the target triple string that must be used in cases marked expected failures 24 config.name = 'host_bcc_debugger_integration' 25 config.suffixes = ['.cpp', '.c'] 26 config.target_triple = 'host-bcc' 27 28 # If the user is running an individual tests directory, we have to load 29 # the libbcc site configuration first 30 build_top = getattr(config, 'build_top', None) 31 if build_top is None: 32 lit.load_config(config, os.path.join(os.getenv('ANDROID_BUILD_TOP', 33 '../../../../../'), 'frameworks', 'compile', 'libbcc', 'tests', 34 'debuginfo', 'lit.site.cfg')) 35 build_top = config.build_top 36 37 # Output directory in the android source tree 38 config.test_exec_root = os.path.join(config.build_top, 'out', 'host', 39 'tests', 'bcc-host') 40 41 # 42 ## Set up environment variables 43 # 44 45 # - LD_LIBRARY_PATH for finding libbcc.so from the android build 46 config.environment['LD_LIBRARY_PATH'] = \ 47 os.path.join(config.base_build_path, 'lib') + ":" + \ 48 config.environment['LD_LIBRARY_PATH'] 49 50 # - DEBUGGER and DEBUGGER_ARGS denote how to invoke the debugger 51 config.environment['DEBUGGER'] = config.gdb 52 config.environment['DEBUGGER_ARGS'] = '-q -batch -n --args ' \ 53 + config.bcc_driver + ' -R ' 54 55 if not lit.quiet: 56 lit.note('using clang: %r' % config.clang) 57 lit.note('using bcc driver: %r' % config.bcc_driver) 58 lit.note('LD_LIBRARY_PATH is %r' % config.environment['LD_LIBRARY_PATH']) 59 60 # Apply host-side test macro substitutions 61 config.substitutions.append( ('%clangxx', ' ' + config.clang + \ 62 ' -ccc-clang-cxx -ccc-cxx ') ) 63 64 config.substitutions.append( ('%extra-clang-opts', ' -emit-llvm -c ') ) 65 66 config.substitutions.append( ('%clang', ' ' + config.clang + ' ') ) 67