Internalize variable names to prevent recursive assignment. Cleanup docs.
[oota-llvm.git] / test / Makefile
1 LEVEL  = ..
2 DIRS   = 
3
4 #
5 # Make QMTest the default for testing features and regressions
6 # Do this first to force QMTest to run first
7 #
8 all:: qmtest
9
10 #
11 # Include other test rules
12 #
13 include Makefile.tests
14
15 #
16 # New QMTest functionality:
17 #       The test suite is being transitioned over to QMTest.  Eventually, it
18 #       will use QMTest by default.
19 #
20
21 # QMTest option specifying the location of the QMTest database.
22 QMDB= -D $(LLVM_SRC_ROOT)/test
23 QMCLASSES=$(LLVM_OBJ_ROOT)/test/QMTest
24
25 #
26 # Determine which expectations file we will use
27 #
28 QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.unknown.qmr
29 ifeq ($(OS),Linux)
30 QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.linux.qmr
31 endif
32
33 ifeq ($(OS),SunOS)
34 QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.sunos.qmr
35 endif
36
37 ifeq ($(OS),Darwin)
38 QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.darwin.qmr
39 endif
40
41 #
42 # This is configuration information used by the test suite.  In QM Test, it's
43 # called a 'context.'
44 #
45 CONTEXT= -c "srcroot=$(LLVM_SRC_ROOT)" \
46          -c "buildroot=$(LLVM_OBJ_ROOT)" \
47          -c "buildtype=$(Configuration)" \
48          -c "tmpdir=$(LLVM_OBJ_ROOT)/test/tmp" \
49          -c "coresize=0" \
50          -c "cc=$(CC)" \
51          -c "cxx=$(CXX)" \
52          -c "llvmgcc=$(LLVMGCC)" \
53          -c "llvmgxx=$(LLVMGXX)" \
54          -c "make=$(MAKE)" \
55          -c "python=$(PYTHON)"
56
57 #
58 # Location of the QMTest program.
59 #
60 QMTEST= QMTEST_CLASS_PATH=$(QMCLASSES) qmtest $(QMDB)
61
62
63 #
64 # Execute the tests
65 #
66 qmtest:: $(LLVM_OBJ_ROOT)/test/tmp register
67         -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT)
68
69 %.t:: $(LLVM_OBJ_ROOT)/test/tmp register
70         -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT) $*
71
72 #
73 # Create the temporary directory used by the test suite.
74 #
75 $(LLVM_OBJ_ROOT)/test/tmp::
76         ${MKDIR} $(LLVM_OBJ_ROOT)/test/tmp
77
78 #
79 # Right now, QMTest compiles the python test classes and put them into the
80 # source tree.  Since Python bytecode is *not* cross-platform compatible (I
81 # think), we'll regenerate every time.
82 #
83 # Simultaneous builds won't work, but shared source trees will.
84 #
85 register:
86         $(QMTEST) register test llvm.TestAsmDisasm
87         $(QMTEST) register test llvm.AssembleTest
88         $(QMTEST) register test llvm.ConvertToCTest
89         $(QMTEST) register test llvm.LLToCTest
90         $(QMTEST) register test llvm.MachineCodeTest
91         $(QMTEST) register test llvm.TestOptimizer
92         $(QMTEST) register test llvm.LLITest
93         $(QMTEST) register test llvm.TestRunner
94         $(QMTEST) register test llvm.VerifierTest
95         $(QMTEST) register test llvm.CTest
96         $(QMTEST) register test llvm.CXXTest
97         $(QMTEST) register database llvmdb.llvmdb
98
99 # Start up the QMTest GUI
100 gui::
101         $(QMTEST) gui --no-browser --daemon
102
103 # Also get rid of qmtest garbage when we 'make clean' in this directory.
104 clean:: qmtest-clean
105
106 qmtest-clean:
107         $(RM) -rf $(LLVM_OBJ_ROOT)/test/tmp
108         $(RM) -f $(LLVM_SRC_ROOT)/test/QMTest/*.pyo \
109                 $(LLVM_OBJ_ROOT)/test/QMTest/*.pyo
110         $(RM) -f $(LLVM_SRC_ROOT)/test/results.qmr \
111                 $(LLVM_OBJ_ROOT)/test/results.qmr
112