Chris Lattner | 12d632c | 2004-11-07 05:05:37 +0000 | [diff] [blame^] | 1 | #===- test/Makefile ----------------------------------------*- Makefile -*--===# |
| 2 | # |
| 3 | # The LLVM Compiler Infrastructure |
| 4 | # |
| 5 | # This file was developed by the LLVM research group and is distributed under |
| 6 | # the University of Illinois Open Source License. See LICENSE.TXT for details. |
| 7 | # |
| 8 | #===------------------------------------------------------------------------===# |
| 9 | |
Vikram S. Adve | 38b8620 | 2001-11-05 00:22:16 +0000 | [diff] [blame] | 10 | LEVEL = .. |
Reid Spencer | eb32ffe | 2004-09-05 08:18:23 +0000 | [diff] [blame] | 11 | DIRS = |
Chris Lattner | 52a4e85 | 2002-01-23 21:36:59 +0000 | [diff] [blame] | 12 | |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 13 | # |
John Criswell | ee29d2a | 2003-09-06 15:12:21 +0000 | [diff] [blame] | 14 | # Make QMTest the default for testing features and regressions |
John Criswell | d184c67 | 2003-10-27 17:46:42 +0000 | [diff] [blame] | 15 | # Do this first to force QMTest to run first |
John Criswell | ee29d2a | 2003-09-06 15:12:21 +0000 | [diff] [blame] | 16 | # |
| 17 | all:: qmtest |
| 18 | |
John Criswell | d184c67 | 2003-10-27 17:46:42 +0000 | [diff] [blame] | 19 | # Include other test rules |
John Criswell | d184c67 | 2003-10-27 17:46:42 +0000 | [diff] [blame] | 20 | include Makefile.tests |
| 21 | |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 22 | # New QMTest functionality: |
| 23 | # The test suite is being transitioned over to QMTest. Eventually, it |
| 24 | # will use QMTest by default. |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 25 | |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 26 | # QMTest option specifying the location of the QMTest database. |
John Criswell | f424d74 | 2003-10-07 21:13:47 +0000 | [diff] [blame] | 27 | QMDB= -D $(LLVM_SRC_ROOT)/test |
| 28 | QMCLASSES=$(LLVM_OBJ_ROOT)/test/QMTest |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 29 | |
| 30 | # |
John Criswell | 236c4d4 | 2003-11-19 21:13:25 +0000 | [diff] [blame] | 31 | # Determine which expectations file we will use |
| 32 | # |
| 33 | QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.unknown.qmr |
| 34 | ifeq ($(OS),Linux) |
| 35 | QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.linux.qmr |
| 36 | endif |
| 37 | |
| 38 | ifeq ($(OS),SunOS) |
| 39 | QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.sunos.qmr |
| 40 | endif |
| 41 | |
John Criswell | d179961 | 2004-03-29 20:23:11 +0000 | [diff] [blame] | 42 | ifeq ($(OS),Darwin) |
| 43 | QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.darwin.qmr |
| 44 | endif |
| 45 | |
John Criswell | 236c4d4 | 2003-11-19 21:13:25 +0000 | [diff] [blame] | 46 | # |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 47 | # This is configuration information used by the test suite. In QM Test, it's |
| 48 | # called a 'context.' |
| 49 | # |
Brian Gaeke | ab9585f | 2003-10-11 00:10:05 +0000 | [diff] [blame] | 50 | CONTEXT= -c "srcroot=$(LLVM_SRC_ROOT)" \ |
| 51 | -c "buildroot=$(LLVM_OBJ_ROOT)" \ |
Brian Gaeke | 64aeb00 | 2004-11-03 17:11:23 +0000 | [diff] [blame] | 52 | -c "buildtype=$(BuildMode)" \ |
Brian Gaeke | ab9585f | 2003-10-11 00:10:05 +0000 | [diff] [blame] | 53 | -c "tmpdir=$(LLVM_OBJ_ROOT)/test/tmp" \ |
| 54 | -c "coresize=0" \ |
| 55 | -c "cc=$(CC)" \ |
| 56 | -c "cxx=$(CXX)" \ |
John Criswell | ee29d2a | 2003-09-06 15:12:21 +0000 | [diff] [blame] | 57 | -c "llvmgcc=$(LLVMGCC)" \ |
John Criswell | 28e7767 | 2003-09-30 19:04:08 +0000 | [diff] [blame] | 58 | -c "llvmgxx=$(LLVMGXX)" \ |
John Criswell | 955a742 | 2004-08-02 22:29:38 +0000 | [diff] [blame] | 59 | -c "make=$(MAKE)" \ |
| 60 | -c "python=$(PYTHON)" |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 61 | |
| 62 | # |
| 63 | # Location of the QMTest program. |
| 64 | # |
John Criswell | 1ce5c59 | 2003-09-16 02:59:26 +0000 | [diff] [blame] | 65 | QMTEST= QMTEST_CLASS_PATH=$(QMCLASSES) qmtest $(QMDB) |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 66 | |
| 67 | |
| 68 | # |
| 69 | # Execute the tests |
| 70 | # |
| 71 | qmtest:: $(LLVM_OBJ_ROOT)/test/tmp register |
John Criswell | 236c4d4 | 2003-11-19 21:13:25 +0000 | [diff] [blame] | 72 | -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT) |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 73 | |
John Criswell | f780f77 | 2003-09-08 21:25:35 +0000 | [diff] [blame] | 74 | %.t:: $(LLVM_OBJ_ROOT)/test/tmp register |
John Criswell | 236c4d4 | 2003-11-19 21:13:25 +0000 | [diff] [blame] | 75 | -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT) $* |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 76 | |
| 77 | # |
| 78 | # Create the temporary directory used by the test suite. |
| 79 | # |
| 80 | $(LLVM_OBJ_ROOT)/test/tmp:: |
| 81 | ${MKDIR} $(LLVM_OBJ_ROOT)/test/tmp |
| 82 | |
| 83 | # |
John Criswell | 538a317 | 2003-09-15 21:54:49 +0000 | [diff] [blame] | 84 | # Right now, QMTest compiles the python test classes and put them into the |
| 85 | # source tree. Since Python bytecode is *not* cross-platform compatible (I |
| 86 | # think), we'll regenerate every time. |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 87 | # |
John Criswell | 538a317 | 2003-09-15 21:54:49 +0000 | [diff] [blame] | 88 | # Simultaneous builds won't work, but shared source trees will. |
| 89 | # |
| 90 | register: |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 91 | $(QMTEST) register test llvm.TestAsmDisasm |
| 92 | $(QMTEST) register test llvm.AssembleTest |
| 93 | $(QMTEST) register test llvm.ConvertToCTest |
| 94 | $(QMTEST) register test llvm.LLToCTest |
| 95 | $(QMTEST) register test llvm.MachineCodeTest |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 96 | $(QMTEST) register test llvm.TestOptimizer |
| 97 | $(QMTEST) register test llvm.LLITest |
| 98 | $(QMTEST) register test llvm.TestRunner |
| 99 | $(QMTEST) register test llvm.VerifierTest |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 100 | $(QMTEST) register test llvm.CTest |
John Criswell | 28e7767 | 2003-09-30 19:04:08 +0000 | [diff] [blame] | 101 | $(QMTEST) register test llvm.CXXTest |
John Criswell | 0c9efc2 | 2003-10-07 21:30:07 +0000 | [diff] [blame] | 102 | $(QMTEST) register database llvmdb.llvmdb |
John Criswell | 299e15e | 2003-08-21 15:09:29 +0000 | [diff] [blame] | 103 | |
John Criswell | 1ce5c59 | 2003-09-16 02:59:26 +0000 | [diff] [blame] | 104 | # Start up the QMTest GUI |
John Criswell | 1ce5c59 | 2003-09-16 02:59:26 +0000 | [diff] [blame] | 105 | gui:: |
| 106 | $(QMTEST) gui --no-browser --daemon |
| 107 | |
Brian Gaeke | aa74118 | 2003-11-21 01:12:47 +0000 | [diff] [blame] | 108 | # 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] | 109 | clean:: qmtest-clean |
| 110 | |
| 111 | qmtest-clean: |
John Criswell | 9fd50e2 | 2003-10-10 19:52:30 +0000 | [diff] [blame] | 112 | $(RM) -rf $(LLVM_OBJ_ROOT)/test/tmp |
Brian Gaeke | 34d25f1 | 2003-11-20 19:57:17 +0000 | [diff] [blame] | 113 | $(RM) -f $(LLVM_SRC_ROOT)/test/QMTest/*.pyo \ |
| 114 | $(LLVM_OBJ_ROOT)/test/QMTest/*.pyo |
Brian Gaeke | aa74118 | 2003-11-21 01:12:47 +0000 | [diff] [blame] | 115 | $(RM) -f $(LLVM_SRC_ROOT)/test/results.qmr \ |
| 116 | $(LLVM_OBJ_ROOT)/test/results.qmr |
John Criswell | 9fd50e2 | 2003-10-10 19:52:30 +0000 | [diff] [blame] | 117 | |
Chris Lattner | 12d632c | 2004-11-07 05:05:37 +0000 | [diff] [blame^] | 118 | #===------------------------------------------------------------------------===# |
| 119 | # DejaGNU testing support |
| 120 | #===------------------------------------------------------------------------===# |
| 121 | |
Tanya Lattner | 7a7cb4c | 2004-11-07 04:59:52 +0000 | [diff] [blame] | 122 | EXPECT = expect |
| 123 | RUNTEST = runtest |
| 124 | |
| 125 | check-dejagnu: site.exp |
| 126 | $(RUNTEST) |
| 127 | |
| 128 | dejagnu-clean: |
Chris Lattner | 12d632c | 2004-11-07 05:05:37 +0000 | [diff] [blame^] | 129 | $(RM) -rf `find $(LLVM_OBJ_ROOT)/test/Regression -name Output -type d -print` |
Tanya Lattner | 7a7cb4c | 2004-11-07 04:59:52 +0000 | [diff] [blame] | 130 | |
| 131 | site.exp: Makefile $(LLVM_OBJ_ROOT)/Makefile.config |
| 132 | @echo 'Making a new site.exp file...' |
| 133 | @echo '## these variables are automatically generated by make ##' >site.tmp |
| 134 | @echo '# Do not edit here. If you wish to override these values' >>site.tmp |
| 135 | @echo '# edit the last section' >>site.tmp |
| 136 | @echo "set target_triplet i686-pc-linux-gnu" >> site.tmp |
| 137 | @echo 'set prcontext $(LLVM_SRC_ROOT)/test/Scripts/prcontext.py' >> site.tmp |
| 138 | @echo 'set srcdir $(LLVM_SRC_ROOT)/test' >>site.tmp |
| 139 | @echo "set objdir $(LLVM_OBJ_ROOT)/test" >>site.tmp |
| 140 | @echo 'set llvmgcc $(LLVMGCCDIR)/bin/gcc' >> site.tmp |
| 141 | @echo 'set llvmgxx $(LLVMGCCDIR)/bin/g++' >> site.tmp |
| 142 | @echo '## All variables above are generated by configure. Do Not Edit ## ' >>site.tmp |
| 143 | @test ! -f site.exp || \ |
| 144 | sed '1,/^## All variables above are.*##/ d' site.exp >> site.tmp |
| 145 | @-rm -f site.bak |
| 146 | @test ! -f site.exp || mv site.exp site.bak |
| 147 | @mv site.tmp site.exp |
Chris Lattner | 12d632c | 2004-11-07 05:05:37 +0000 | [diff] [blame^] | 148 | |