blob: be621518f2ab80acabb31edb59f1e936a74df35d [file] [log] [blame]
Vikram S. Adve38b86202001-11-05 00:22:16 +00001LEVEL = ..
Reid Spencereb32ffe2004-09-05 08:18:23 +00002DIRS =
Chris Lattner52a4e852002-01-23 21:36:59 +00003
John Criswell299e15e2003-08-21 15:09:29 +00004#
John Criswellee29d2a2003-09-06 15:12:21 +00005# Make QMTest the default for testing features and regressions
John Criswelld184c672003-10-27 17:46:42 +00006# Do this first to force QMTest to run first
John Criswellee29d2a2003-09-06 15:12:21 +00007#
8all:: qmtest
9
10#
John Criswelld184c672003-10-27 17:46:42 +000011# Include other test rules
12#
13include Makefile.tests
14
15#
John Criswell299e15e2003-08-21 15:09:29 +000016# New QMTest functionality:
17# The test suite is being transitioned over to QMTest. Eventually, it
18# will use QMTest by default.
19#
20
John Criswell299e15e2003-08-21 15:09:29 +000021# QMTest option specifying the location of the QMTest database.
John Criswellf424d742003-10-07 21:13:47 +000022QMDB= -D $(LLVM_SRC_ROOT)/test
23QMCLASSES=$(LLVM_OBJ_ROOT)/test/QMTest
John Criswell299e15e2003-08-21 15:09:29 +000024
25#
John Criswell236c4d42003-11-19 21:13:25 +000026# Determine which expectations file we will use
27#
28QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.unknown.qmr
29ifeq ($(OS),Linux)
30QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.linux.qmr
31endif
32
33ifeq ($(OS),SunOS)
34QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.sunos.qmr
35endif
36
John Criswelld1799612004-03-29 20:23:11 +000037ifeq ($(OS),Darwin)
38QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.darwin.qmr
39endif
40
John Criswell236c4d42003-11-19 21:13:25 +000041#
John Criswell299e15e2003-08-21 15:09:29 +000042# This is configuration information used by the test suite. In QM Test, it's
43# called a 'context.'
44#
Brian Gaekeab9585f2003-10-11 00:10:05 +000045CONTEXT= -c "srcroot=$(LLVM_SRC_ROOT)" \
46 -c "buildroot=$(LLVM_OBJ_ROOT)" \
Brian Gaeke64aeb002004-11-03 17:11:23 +000047 -c "buildtype=$(BuildMode)" \
Brian Gaekeab9585f2003-10-11 00:10:05 +000048 -c "tmpdir=$(LLVM_OBJ_ROOT)/test/tmp" \
49 -c "coresize=0" \
50 -c "cc=$(CC)" \
51 -c "cxx=$(CXX)" \
John Criswellee29d2a2003-09-06 15:12:21 +000052 -c "llvmgcc=$(LLVMGCC)" \
John Criswell28e77672003-09-30 19:04:08 +000053 -c "llvmgxx=$(LLVMGXX)" \
John Criswell955a7422004-08-02 22:29:38 +000054 -c "make=$(MAKE)" \
55 -c "python=$(PYTHON)"
John Criswell299e15e2003-08-21 15:09:29 +000056
57#
58# Location of the QMTest program.
59#
John Criswell1ce5c592003-09-16 02:59:26 +000060QMTEST= QMTEST_CLASS_PATH=$(QMCLASSES) qmtest $(QMDB)
John Criswell299e15e2003-08-21 15:09:29 +000061
62
63#
64# Execute the tests
65#
66qmtest:: $(LLVM_OBJ_ROOT)/test/tmp register
John Criswell236c4d42003-11-19 21:13:25 +000067 -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT)
John Criswell299e15e2003-08-21 15:09:29 +000068
John Criswellf780f772003-09-08 21:25:35 +000069%.t:: $(LLVM_OBJ_ROOT)/test/tmp register
John Criswell236c4d42003-11-19 21:13:25 +000070 -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT) $*
John Criswell299e15e2003-08-21 15:09:29 +000071
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#
John Criswell538a3172003-09-15 21:54:49 +000079# 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.
John Criswell299e15e2003-08-21 15:09:29 +000082#
John Criswell538a3172003-09-15 21:54:49 +000083# Simultaneous builds won't work, but shared source trees will.
84#
85register:
John Criswell299e15e2003-08-21 15:09:29 +000086 $(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
John Criswell299e15e2003-08-21 15:09:29 +000091 $(QMTEST) register test llvm.TestOptimizer
92 $(QMTEST) register test llvm.LLITest
93 $(QMTEST) register test llvm.TestRunner
94 $(QMTEST) register test llvm.VerifierTest
John Criswell299e15e2003-08-21 15:09:29 +000095 $(QMTEST) register test llvm.CTest
John Criswell28e77672003-09-30 19:04:08 +000096 $(QMTEST) register test llvm.CXXTest
John Criswell0c9efc22003-10-07 21:30:07 +000097 $(QMTEST) register database llvmdb.llvmdb
John Criswell299e15e2003-08-21 15:09:29 +000098
John Criswell1ce5c592003-09-16 02:59:26 +000099# Start up the QMTest GUI
John Criswell1ce5c592003-09-16 02:59:26 +0000100gui::
101 $(QMTEST) gui --no-browser --daemon
102
Brian Gaekeaa741182003-11-21 01:12:47 +0000103# Also get rid of qmtest garbage when we 'make clean' in this directory.
Brian Gaekef19ae4c2003-12-11 04:48:38 +0000104clean:: qmtest-clean
105
106qmtest-clean:
John Criswell9fd50e22003-10-10 19:52:30 +0000107 $(RM) -rf $(LLVM_OBJ_ROOT)/test/tmp
Brian Gaeke34d25f12003-11-20 19:57:17 +0000108 $(RM) -f $(LLVM_SRC_ROOT)/test/QMTest/*.pyo \
109 $(LLVM_OBJ_ROOT)/test/QMTest/*.pyo
Brian Gaekeaa741182003-11-21 01:12:47 +0000110 $(RM) -f $(LLVM_SRC_ROOT)/test/results.qmr \
111 $(LLVM_OBJ_ROOT)/test/results.qmr
John Criswell9fd50e22003-10-10 19:52:30 +0000112
Tanya Lattner7a7cb4c2004-11-07 04:59:52 +0000113EXPECT = expect
114RUNTEST = runtest
115
116check-dejagnu: site.exp
117 $(RUNTEST)
118
119dejagnu-clean:
120 cd $(LLVM_OBJ_ROOT)/test/
121 $(RM) -rf Regression/*/Output
122 $(RM) -rf Regression/*/*/Output
123
124site.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
138 @-rm -f site.bak
139 @test ! -f site.exp || mv site.exp site.bak
140 @mv site.tmp site.exp