5 # Make QMTest the default for testing features and regressions
6 # Do this first to force QMTest to run first
11 # Include other test rules
13 include Makefile.tests
16 # New QMTest functionality:
17 # The test suite is being transitioned over to QMTest. Eventually, it
18 # will use QMTest by default.
21 # QMTest option specifying the location of the QMTest database.
22 QMDB= -D $(LLVM_SRC_ROOT)/test
23 QMCLASSES=$(LLVM_OBJ_ROOT)/test/QMTest
26 # Determine which expectations file we will use
28 QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.unknown.qmr
30 QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.linux.qmr
34 QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.sunos.qmr
38 QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.darwin.qmr
42 # This is configuration information used by the test suite. In QM Test, it's
45 CONTEXT= -c "srcroot=$(LLVM_SRC_ROOT)" \
46 -c "buildroot=$(LLVM_OBJ_ROOT)" \
47 -c "buildtype=$(BuildMode)" \
48 -c "tmpdir=$(LLVM_OBJ_ROOT)/test/tmp" \
52 -c "llvmgcc=$(LLVMGCC)" \
53 -c "llvmgxx=$(LLVMGXX)" \
58 # Location of the QMTest program.
60 QMTEST= QMTEST_CLASS_PATH=$(QMCLASSES) qmtest $(QMDB)
66 qmtest:: $(LLVM_OBJ_ROOT)/test/tmp register
67 -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT)
69 %.t:: $(LLVM_OBJ_ROOT)/test/tmp register
70 -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT) $*
73 # Create the temporary directory used by the test suite.
75 $(LLVM_OBJ_ROOT)/test/tmp::
76 ${MKDIR} $(LLVM_OBJ_ROOT)/test/tmp
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.
83 # Simultaneous builds won't work, but shared source trees will.
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
99 # Start up the QMTest GUI
101 $(QMTEST) gui --no-browser --daemon
103 # Also get rid of qmtest garbage when we 'make clean' in this directory.
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
116 check-dejagnu: site.exp
120 cd $(LLVM_OBJ_ROOT)/test/
121 $(RM) -rf Regression/*/Output
122 $(RM) -rf Regression/*/*/Output
124 site.exp: Makefile $(LLVM_OBJ_ROOT)/Makefile.config
125 @echo 'Making a new site.exp file...'
126 @echo '## these variables are automatically generated by make ##' >site.tmp
127 @echo '# Do not edit here. If you wish to override these values' >>site.tmp
128 @echo '# edit the last section' >>site.tmp
129 @echo "set target_triplet i686-pc-linux-gnu" >> site.tmp
130 @echo 'set prcontext $(LLVM_SRC_ROOT)/test/Scripts/prcontext.py' >> site.tmp
131 @echo 'set srcdir $(LLVM_SRC_ROOT)/test' >>site.tmp
132 @echo "set objdir $(LLVM_OBJ_ROOT)/test" >>site.tmp
133 @echo 'set llvmgcc $(LLVMGCCDIR)/bin/gcc' >> site.tmp
134 @echo 'set llvmgxx $(LLVMGCCDIR)/bin/g++' >> site.tmp
135 @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp
136 @test ! -f site.exp || \
137 sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp
139 @test ! -f site.exp || mv site.exp site.bak
140 @mv site.tmp site.exp