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