Initial checkin of regression test for generating the PowerPC rlwimi
[oota-llvm.git] / test / Makefile
index 3b98ef8b98b1f9722f226ba9052e8a558b5a87f9..c3244d66093b1280311864ef6806296c383048c0 100644 (file)
@@ -1,5 +1,5 @@
 LEVEL  = ..
-DIRS   = Programs
+DIRS   = 
 
 #
 # Make QMTest the default for testing features and regressions
@@ -22,6 +22,22 @@ include Makefile.tests
 QMDB= -D $(LLVM_SRC_ROOT)/test
 QMCLASSES=$(LLVM_OBJ_ROOT)/test/QMTest
 
+#
+# Determine which expectations file we will use
+#
+QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.unknown.qmr
+ifeq ($(OS),Linux)
+QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.linux.qmr
+endif
+
+ifeq ($(OS),SunOS)
+QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.sunos.qmr
+endif
+
+ifeq ($(OS),Darwin)
+QMEXPECT:=$(LLVM_SRC_ROOT)/test/QMTest/expectations.darwin.qmr
+endif
+
 #
 # This is configuration information used by the test suite.  In QM Test, it's
 # called a 'context.'
@@ -35,7 +51,8 @@ CONTEXT= -c "srcroot=$(LLVM_SRC_ROOT)" \
          -c "cxx=$(CXX)" \
          -c "llvmgcc=$(LLVMGCC)" \
          -c "llvmgxx=$(LLVMGXX)" \
-         -c "make=$(MAKE)"
+         -c "make=$(MAKE)" \
+         -c "python=$(PYTHON)"
 
 #
 # Location of the QMTest program.
@@ -47,10 +64,10 @@ QMTEST= QMTEST_CLASS_PATH=$(QMCLASSES) qmtest $(QMDB)
 # Execute the tests
 #
 qmtest:: $(LLVM_OBJ_ROOT)/test/tmp register
-       -$(QMTEST) run -O $(LLVM_SRC_ROOT)/test/QMTest/expectations.qmr $(CONTEXT)
+       -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT)
 
 %.t:: $(LLVM_OBJ_ROOT)/test/tmp register
-       -$(QMTEST) run -O $(LLVM_SRC_ROOT)/test/QMTest/expectations.qmr $(CONTEXT) $*
+       -$(QMTEST) run -O $(QMEXPECT) $(CONTEXT) $*
 
 #
 # Create the temporary directory used by the test suite.
@@ -79,12 +96,17 @@ register:
        $(QMTEST) register test llvm.CXXTest
        $(QMTEST) register database llvmdb.llvmdb
 
-#
 # Start up the QMTest GUI
-#
 gui::
        $(QMTEST) gui --no-browser --daemon
 
-clean::
+# Also get rid of qmtest garbage when we 'make clean' in this directory.
+clean:: qmtest-clean
+
+qmtest-clean:
        $(RM) -rf $(LLVM_OBJ_ROOT)/test/tmp
+       $(RM) -f $(LLVM_SRC_ROOT)/test/QMTest/*.pyo \
+               $(LLVM_OBJ_ROOT)/test/QMTest/*.pyo
+       $(RM) -f $(LLVM_SRC_ROOT)/test/results.qmr \
+               $(LLVM_OBJ_ROOT)/test/results.qmr