1094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# -*- Python -*- 2094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# 3094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# Copyright (C) 2012 The Android Open Source Project 4094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# 5094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# Licensed under the Apache License, Version 2.0 (the "License"); 6094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# you may not use this file except in compliance with the License. 7094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# You may obtain a copy of the License at 8094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# 9094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# http://www.apache.org/licenses/LICENSE-2.0 10094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# 11094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# Unless required by applicable law or agreed to in writing, software 12094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# distributed under the License is distributed on an "AS IS" BASIS, 13094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# See the License for the specific language governing permissions and 15094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# limitations under the License. 16094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# 17094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 18094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# 19094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea### Configuration file for target side debugger integration tests 20094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# 21094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 22094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# Set up the suite name, extensions that are recognized as testcases, and 23094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# the target triple string that must be used in cases marked expected failures 24094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleaconfig.name = 'host_bcc_debugger_integration' 25094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleaconfig.suffixes = ['.cpp', '.c'] 26094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleaconfig.target_triple = 'host-bcc' 27094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 28094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# If the user is running an individual tests directory, we have to load 29094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# the libbcc site configuration first 30094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleabuild_top = getattr(config, 'build_top', None) 31094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleaif build_top is None: 32094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea lit.load_config(config, os.path.join(os.getenv('ANDROID_BUILD_TOP', 33094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea '../../../../../'), 'frameworks', 'compile', 'libbcc', 'tests', 34094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 'debuginfo', 'lit.site.cfg')) 35094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea build_top = config.build_top 36094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 37094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# Output directory in the android source tree 38094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleaconfig.test_exec_root = os.path.join(config.build_top, 'out', 'host', 39094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 'tests', 'bcc-host') 40094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 41094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# 42094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea## Set up environment variables 43094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# 44094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 45094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# - LD_LIBRARY_PATH for finding libbcc.so from the android build 46094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleaconfig.environment['LD_LIBRARY_PATH'] = \ 47094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea os.path.join(config.base_build_path, 'lib') + ":" + \ 48094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea config.environment['LD_LIBRARY_PATH'] 49094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 50094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# - DEBUGGER and DEBUGGER_ARGS denote how to invoke the debugger 51094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleaconfig.environment['DEBUGGER'] = config.gdb 52094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleaconfig.environment['DEBUGGER_ARGS'] = '-q -batch -n --args ' \ 53094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea + config.bcc_driver + ' -R ' 54094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 55094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleaif not lit.quiet: 56094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea lit.note('using clang: %r' % config.clang) 57094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea lit.note('using bcc driver: %r' % config.bcc_driver) 58094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea lit.note('LD_LIBRARY_PATH is %r' % config.environment['LD_LIBRARY_PATH']) 59094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 60094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea# Apply host-side test macro substitutions 61094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleaconfig.substitutions.append( ('%clangxx', ' ' + config.clang + \ 62094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea ' -ccc-clang-cxx -ccc-cxx ') ) 63094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 64094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleaconfig.substitutions.append( ('%extra-clang-opts', ' -emit-llvm -c ') ) 65094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Malea 66094881f513ab366f7ffd0b2c7778ab50281ca59eDaniel Maleaconfig.substitutions.append( ('%clang', ' ' + config.clang + ' ') ) 67