1#!/usr/bin/env python
2
3import os
4import sys
5
6# In the Android tree, use the environment variables set by envsetup.sh
7# to determine correct path for the root of the source tree.
8# TODO: To run clang tests, @LLVM_BINARY_DIR@ must be substituted also.
9android_source_root = os.getenv('ANDROID_BUILD_TOP', ".")
10llvm_source_root = os.path.join(android_source_root, 'external', 'llvm')
11libbcc_source_root = os.path.join(android_source_root, 'frameworks', 'compile',
12  'libbcc')
13
14# Make sure we can find the lit package.
15sys.path.append(os.path.join(llvm_source_root, 'utils', 'lit'))
16
17# Set up some builtin parameters, so that by default the LLVM test suite
18# configuration file knows how to find the object tree.
19builtin_parameters = {
20    'llvm_site_config' : os.path.join(libbcc_source_root, 'test', 'debuginfo',
21                                      'lit.site.cfg')
22    }
23
24if __name__=='__main__':
25    import lit
26    lit.main(builtin_parameters)
27