X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2FMakefile;h=29f823666a88cef6cfba210de9a7cbe173211054;hb=e8a63eb78fc38853f951d77d171461e7ff651ad4;hp=1d43f8b4fe5071b0acbba7ecb74c859d08b33a4c;hpb=5341e214d993c75e5e4b34b0c848ce008ae68340;p=oota-llvm.git diff --git a/test/Makefile b/test/Makefile index 1d43f8b4fe5..29f823666a8 100644 --- a/test/Makefile +++ b/test/Makefile @@ -1,42 +1,85 @@ -LLVM := .. -LLC := $(LLVM)/tools/llc/llc -AS := $(LLVM)/tools/as/as -LLCOPTS := -dsched t +LEVEL = .. +DIRS = Programs +include Makefile.tests -TESTS := $(wildcard *.ll) +# +# Make QMTest the default for testing features and regressions +# +all:: qmtest -LLCTESTS := $(shell /bin/ls *.ll | grep -v testmemory | grep -v testswitch | grep -v sumarray) +# +# New QMTest functionality: +# The test suite is being transitioned over to QMTest. Eventually, it +# will use QMTest by default. +# +# QMTest option specifying the location of the QMTest database. +QMDB= -D $(LLVM_SRC_ROOT)/test +QMCLASSES=$(LLVM_OBJ_ROOT)/test/QMTest -test all : testasmdis testopt testcodegen - @echo "All tests successfully completed!" +# +# This is configuration information used by the test suite. In QM Test, it's +# called a 'context.' +# +CONTEXT= -c "srcroot=$(LLVM_SRC_ROOT)" \ + -c "buildroot=$(LLVM_OBJ_ROOT)" \ + -c "buildtype=$(CONFIGURATION)" \ + -c "tmpdir=$(LLVM_OBJ_ROOT)/test/tmp" \ + -c "coresize=0" \ + -c "cc=$(CC)" \ + -c "cxx=$(CXX)" \ + -c "llvmgcc=$(LLVMGCC)" \ + -c "llvmgxx=$(LLVMGXX)" \ + -c "make=$(MAKE)" -testasmdis : $(TESTS:%.ll=%.ll.asmdis) - @echo "All assembler/disassembler test succeeded!" +# +# Location of the QMTest program. +# +QMTEST= QMTEST_CLASS_PATH=$(QMCLASSES) qmtest $(QMDB) -testopt : $(TESTS:%.ll=%.ll.opt) -testselect : $(LLCTESTS:%.ll=%.mc) +# +# Execute the tests +# +qmtest:: $(LLVM_OBJ_ROOT)/test/tmp register + -$(QMTEST) run -O $(LLVM_SRC_ROOT)/test/QMTest/expectations.qmr $(CONTEXT) -testsched : $(LLCTESTS:%.ll=%.mc) +%.t:: $(LLVM_OBJ_ROOT)/test/tmp register + -$(QMTEST) run -O $(LLVM_SRC_ROOT)/test/QMTest/expectations.qmr $(CONTEXT) $* -testcodegen : $(LLCTESTS:%.ll=%.mc) +# +# Create the temporary directory used by the test suite. +# +$(LLVM_OBJ_ROOT)/test/tmp:: + ${MKDIR} $(LLVM_OBJ_ROOT)/test/tmp -clean : - rm -f *.[123] *.bc *.mc core +# +# Right now, QMTest compiles the python test classes and put them into the +# source tree. Since Python bytecode is *not* cross-platform compatible (I +# think), we'll regenerate every time. +# +# Simultaneous builds won't work, but shared source trees will. +# +register: + $(QMTEST) register test llvm.TestAsmDisasm + $(QMTEST) register test llvm.AssembleTest + $(QMTEST) register test llvm.ConvertToCTest + $(QMTEST) register test llvm.LLToCTest + $(QMTEST) register test llvm.MachineCodeTest + $(QMTEST) register test llvm.TestOptimizer + $(QMTEST) register test llvm.LLITest + $(QMTEST) register test llvm.TestRunner + $(QMTEST) register test llvm.VerifierTest + $(QMTEST) register test llvm.CTest + $(QMTEST) register test llvm.CXXTest + $(QMTEST) register database llvmdb.llvmdb -%.asmdis: % - @echo "Running assembler/disassembler test on $<" - @./TestAsmDisasm.sh $< +# +# Start up the QMTest GUI +# +gui:: + $(QMTEST) gui --no-browser --daemon -%.opt: % - @echo "Running optimizier test on $<" - @./TestOptimizer.sh $< - -%.bc: %.ll - $(AS) $< -f - -%.mc: %.ll - @echo "Generating machine instructions for $<" - $(AS) < $< | $(LLC) -dsched=t > $@ +clean:: + $(RM) -rf $(LLVM_OBJ_ROOT)/test/tmp