llvm.org GIT mirror llvm / b7698a4
tests: Add an 'llvm-lit' tool (script), which gets generated as part of the build and has the object build directory baked into it. This allows 'llvm-lit' to properly find the information needed to run the test suite in all cases, without requiring the user to have LLVM or 'lit' available in their PATH, for example. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110000 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Dunbar 9 years ago
3 changed file(s) with 44 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
77 ##===----------------------------------------------------------------------===##
88
99 LEVEL = ..
10 PARALLEL_DIRS := TableGen fpcmp PerfectShuffle FileCheck FileUpdate count not unittest
10 PARALLEL_DIRS := FileCheck FileUpdate TableGen PerfectShuffle \
11 count fpcmp llvm-lit not unittest
1112
1213 EXTRA_DIST := cgiplotNLT.pl check-each-file codegen-diff countloc.sh cvsupdate \
1314 DSAclean.py DSAextract.py emacs findsym.pl GenLibDeps.pl \
0 ##===- utils/llvm-lit/Makefile -----------------------------*- Makefile -*-===##
1 #
2 # The LLVM Compiler Infrastructure
3 #
4 # This file is distributed under the University of Illinois Open Source
5 # License. See LICENSE.TXT for details.
6 #
7 ##===----------------------------------------------------------------------===##
8
9 LEVEL = ../..
10
11 include $(LEVEL)/Makefile.common
12
13 all:: $(ToolDir)/llvm-lit
14
15 $(ToolDir)/llvm-lit: llvm-lit.in $(ObjDir)/.dir
16 $(Echo) "Creating 'llvm-lit' script..."
17 $(Verb)sed -e "s#@LLVM_SOURCE_DIR@#$(LLVM_SRC_ROOT)#g" \
18 -e "s#@LLVM_BINARY_DIR@#$(LLVM_OBJ_ROOT)#g" \
19 $< > $@
20 $(Verb)chmod +x $@
0 #!/usr/bin/env python
1
2 import os
3 import sys
4
5 # Variables configured at build time.
6 llvm_source_root = "@LLVM_SOURCE_DIR@"
7 llvm_obj_root = "@LLVM_BINARY_DIR@"
8
9 # Make sure we can find the lit package.
10 sys.path.append(os.path.join(llvm_source_root, 'utils', 'lit'))
11
12 # Set up some builtin parameters, so that by default the LLVM test suite
13 # configuration file knows how to find the object tree.
14 builtin_parameters = {
15 'llvm_site_config' : os.path.join(llvm_obj_root, 'test', 'lit.site.cfg')
16 }
17
18 if __name__=='__main__':
19 import lit
20 lit.main(builtin_parameters)