Vikram S. Adve | 38b8620 | 2001-11-05 00:22:16 +0000 | [diff] [blame] | 1 | LEVEL = .. |
Reid Spencer | eb32ffe | 2004-09-05 08:18:23 +0000 | [diff] [blame] | 2 | DIRS = |
Chris Lattner | 52a4e85 | 2002-01-23 21:36:59 +0000 | [diff] [blame] | 3 | |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 4 | # |
John Criswell | ee29d2a | 2003-09-06 15:12:21 +0000 | [diff] [blame] | 5 | # Make QMTest the default for testing features and regressions |
John Criswell | d184c67 | 2003-10-27 17:46:42 +0000 | [diff] [blame] | 6 | # Do this first to force QMTest to run first |
John Criswell | ee29d2a | 2003-09-06 15:12:21 +0000 | [diff] [blame] | 7 | # |
| 8 | all:: qmtest |
| 9 | |
| 10 | # |
John Criswell | d184c67 | 2003-10-27 17:46:42 +0000 | [diff] [blame] | 11 | # Include other test rules |
| 12 | # |
| 13 | include Makefile.tests |
| 14 | |
| 15 | # |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 16 | # New QMTest functionality: |
| 17 | # The test suite is being transitioned over to QMTest. Eventually, it |
| 18 | # will use QMTest by default. |
| 19 | # |
| 20 | |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 21 | # QMTest option specifying the location of the QMTest database. |
John Criswell | f424d74 | 2003-10-07 21:13:47 +0000 | [diff] [blame] | 22 | QMDB= -D $(LLVM_SRC_ROOT)/test |
| 23 | QMCLASSES=$(LLVM_OBJ_ROOT)/test/QMTest |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 24 | |
| 25 | # |
John Criswell | 236c4d4 | 2003-11-19 21:13:25 +0000 | [diff] [blame] | 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 | |
John Criswell | d179961 | 2004-03-29 20:23:11 +0000 | [diff] [blame] | 37 | ifeq ($(OS),Darwin) |
| 38 | QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.darwin.qmr |
| 39 | endif |
| 40 | |
John Criswell | 236c4d4 | 2003-11-19 21:13:25 +0000 | [diff] [blame] | 41 | # |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 42 | # This is configuration information used by the test suite. In QM Test, it's |
| 43 | # called a 'context.' |
| 44 | # |
Brian Gaeke | ab9585f | 2003-10-11 00:10:05 +0000 | [diff] [blame] | 45 | CONTEXT= -c "srcroot=$(LLVM_SRC_ROOT)" \ |
| 46 | -c "buildroot=$(LLVM_OBJ_ROOT)" \ |
Brian Gaeke | 64aeb00 | 2004-11-03 17:11:23 +0000 | [diff] [blame] | 47 | -c "buildtype=$(BuildMode)" \ |
Brian Gaeke | ab9585f | 2003-10-11 00:10:05 +0000 | [diff] [blame] | 48 | -c "tmpdir=$(LLVM_OBJ_ROOT)/test/tmp" \ |
| 49 | -c "coresize=0" \ |
| 50 | -c "cc=$(CC)" \ |
| 51 | -c "cxx=$(CXX)" \ |
John Criswell | ee29d2a | 2003-09-06 15:12:21 +0000 | [diff] [blame] | 52 | -c "llvmgcc=$(LLVMGCC)" \ |
John Criswell | 28e7767 | 2003-09-30 19:04:08 +0000 | [diff] [blame] | 53 | -c "llvmgxx=$(LLVMGXX)" \ |
John Criswell | 955a742 | 2004-08-02 22:29:38 +0000 | [diff] [blame] | 54 | -c "make=$(MAKE)" \ |
| 55 | -c "python=$(PYTHON)" |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 56 | |
| 57 | # |
| 58 | # Location of the QMTest program. |
| 59 | # |
John Criswell | 1ce5c59 | 2003-09-16 02:59:26 +0000 | [diff] [blame] | 60 | QMTEST= QMTEST_CLASS_PATH=$(QMCLASSES) qmtest $(QMDB) |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 61 | |
| 62 | |
| 63 | # |
| 64 | # Execute the tests |
| 65 | # |
| 66 | qmtest:: $(LLVM_OBJ_ROOT)/test/tmp register |
John Criswell | 236c4d4 | 2003-11-19 21:13:25 +0000 | [diff] [blame] | 67 | -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT) |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 68 | |
John Criswell | f780f77 | 2003-09-08 21:25:35 +0000 | [diff] [blame] | 69 | %.t:: $(LLVM_OBJ_ROOT)/test/tmp register |
John Criswell | 236c4d4 | 2003-11-19 21:13:25 +0000 | [diff] [blame] | 70 | -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT) $* |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 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 | # |
John Criswell | 538a317 | 2003-09-15 21:54:49 +0000 | [diff] [blame] | 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. |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 82 | # |
John Criswell | 538a317 | 2003-09-15 21:54:49 +0000 | [diff] [blame] | 83 | # Simultaneous builds won't work, but shared source trees will. |
| 84 | # |
| 85 | register: |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 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 |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 91 | $(QMTEST) register test llvm.TestOptimizer |
| 92 | $(QMTEST) register test llvm.LLITest |
| 93 | $(QMTEST) register test llvm.TestRunner |
| 94 | $(QMTEST) register test llvm.VerifierTest |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 95 | $(QMTEST) register test llvm.CTest |
John Criswell | 28e7767 | 2003-09-30 19:04:08 +0000 | [diff] [blame] | 96 | $(QMTEST) register test llvm.CXXTest |
John Criswell | 0c9efc2 | 2003-10-07 21:30:07 +0000 | [diff] [blame] | 97 | $(QMTEST) register database llvmdb.llvmdb |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 98 | |
John Criswell | 1ce5c59 | 2003-09-16 02:59:26 +0000 | [diff] [blame] | 99 | # Start up the QMTest GUI |
John Criswell | 1ce5c59 | 2003-09-16 02:59:26 +0000 | [diff] [blame] | 100 | gui:: |
| 101 | $(QMTEST) gui --no-browser --daemon |
| 102 | |
Brian Gaeke | aa74118 | 2003-11-21 01:12:47 +0000 | [diff] [blame] | 103 | # Also get rid of qmtest garbage when we 'make clean' in this directory. |
Brian Gaeke | f19ae4c | 2003-12-11 04:48:38 +0000 | [diff] [blame] | 104 | clean:: qmtest-clean |
| 105 | |
| 106 | qmtest-clean: |
John Criswell | 9fd50e2 | 2003-10-10 19:52:30 +0000 | [diff] [blame] | 107 | $(RM) -rf $(LLVM_OBJ_ROOT)/test/tmp |
Brian Gaeke | 34d25f1 | 2003-11-20 19:57:17 +0000 | [diff] [blame] | 108 | $(RM) -f $(LLVM_SRC_ROOT)/test/QMTest/*.pyo \ |
| 109 | $(LLVM_OBJ_ROOT)/test/QMTest/*.pyo |
Brian Gaeke | aa74118 | 2003-11-21 01:12:47 +0000 | [diff] [blame] | 110 | $(RM) -f $(LLVM_SRC_ROOT)/test/results.qmr \ |
| 111 | $(LLVM_OBJ_ROOT)/test/results.qmr |
John Criswell | 9fd50e2 | 2003-10-10 19:52:30 +0000 | [diff] [blame] | 112 | |
Tanya Lattner | 7a7cb4c | 2004-11-07 04:59:52 +0000 | [diff] [blame^] | 113 | EXPECT = expect |
| 114 | RUNTEST = runtest |
| 115 | |
| 116 | check-dejagnu: site.exp |
| 117 | $(RUNTEST) |
| 118 | |
| 119 | dejagnu-clean: |
| 120 | cd $(LLVM_OBJ_ROOT)/test/ |
| 121 | $(RM) -rf Regression/*/Output |
| 122 | $(RM) -rf Regression/*/*/Output |
| 123 | |
| 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 |
| 138 | @-rm -f site.bak |
| 139 | @test ! -f site.exp || mv site.exp site.bak |
| 140 | @mv site.tmp site.exp |