Fixed the CBE on Solaris/Sparc. We need to define the return value of
[oota-llvm.git] / test / Makefile
1 LEVEL  = ..
2 DIRS   = Programs
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 #
38 # This is configuration information used by the test suite.  In QM Test, it's
39 # called a 'context.'
40 #
41 CONTEXT= -c "srcroot=$(LLVM_SRC_ROOT)" \
42          -c "buildroot=$(LLVM_OBJ_ROOT)" \
43          -c "buildtype=$(CONFIGURATION)" \
44          -c "tmpdir=$(LLVM_OBJ_ROOT)/test/tmp" \
45          -c "coresize=0" \
46          -c "cc=$(CC)" \
47          -c "cxx=$(CXX)" \
48          -c "llvmgcc=$(LLVMGCC)" \
49          -c "llvmgxx=$(LLVMGXX)" \
50          -c "make=$(MAKE)"
51
52 #
53 # Location of the QMTest program.
54 #
55 QMTEST= QMTEST_CLASS_PATH=$(QMCLASSES) qmtest $(QMDB)
56
57
58 #
59 # Execute the tests
60 #
61 qmtest:: $(LLVM_OBJ_ROOT)/test/tmp register
62         -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT)
63
64 %.t:: $(LLVM_OBJ_ROOT)/test/tmp register
65         -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT) $*
66
67 #
68 # Create the temporary directory used by the test suite.
69 #
70 $(LLVM_OBJ_ROOT)/test/tmp::
71         ${MKDIR} $(LLVM_OBJ_ROOT)/test/tmp
72
73 #
74 # Right now, QMTest compiles the python test classes and put them into the
75 # source tree.  Since Python bytecode is *not* cross-platform compatible (I
76 # think), we'll regenerate every time.
77 #
78 # Simultaneous builds won't work, but shared source trees will.
79 #
80 register:
81         $(QMTEST) register test llvm.TestAsmDisasm
82         $(QMTEST) register test llvm.AssembleTest
83         $(QMTEST) register test llvm.ConvertToCTest
84         $(QMTEST) register test llvm.LLToCTest
85         $(QMTEST) register test llvm.MachineCodeTest
86         $(QMTEST) register test llvm.TestOptimizer
87         $(QMTEST) register test llvm.LLITest
88         $(QMTEST) register test llvm.TestRunner
89         $(QMTEST) register test llvm.VerifierTest
90         $(QMTEST) register test llvm.CTest
91         $(QMTEST) register test llvm.CXXTest
92         $(QMTEST) register database llvmdb.llvmdb
93
94 # Start up the QMTest GUI
95 gui::
96         $(QMTEST) gui --no-browser --daemon
97
98 # Also get rid of qmtest garbage when we 'make clean' in this directory.
99 clean::
100         $(RM) -rf $(LLVM_OBJ_ROOT)/test/tmp
101         $(RM) -f $(LLVM_SRC_ROOT)/test/QMTest/*.pyo \
102                 $(LLVM_OBJ_ROOT)/test/QMTest/*.pyo
103         $(RM) -f $(LLVM_SRC_ROOT)/test/results.qmr \
104                 $(LLVM_OBJ_ROOT)/test/results.qmr
105