Allow tests to behave differently depending on whether the compiler is in-tree
authorIan Lynagh <igloo@earth.li>
Fri, 18 Dec 2009 20:03:58 +0000 (20:03 +0000)
committerIan Lynagh <igloo@earth.li>
Fri, 18 Dec 2009 20:03:58 +0000 (20:03 +0000)
And skip testwsdeque if it is not in-tree, as we rely on some headers
from the build tree.

testsuite/config/ghc
testsuite/driver/testglobals.py
testsuite/driver/testlib.py
testsuite/mk/boilerplate.mk
testsuite/mk/test.mk
testsuite/tests/ghc-regress/rts/all.T

index 7294b8f..3c1b38e 100644 (file)
@@ -56,6 +56,8 @@ if (ghc_with_dynamic_rts == 1):
 if (ghc_with_profiling == 1 and ghc_with_threaded_rts == 1):
         config.run_ways.append('profthreaded')
 
+config.in_tree_compiler = in_tree_compiler
+
 config.way_flags = {
        'normal'     : [],
        'optc'       : ['-O -fvia-C'],
index e23aa41..79fc136 100644 (file)
@@ -84,6 +84,9 @@ class TestConfig:
         # Do we have shared libraries?
         self.have_shared_libs = False
 
+        # Are we testing an in-tree compiler?
+        self.in_tree_compiler = True
+
         # the timeout program
         self.timeout_prog = ''
         self.timeout = 300
index 09c4f23..e1bb411 100644 (file)
@@ -274,6 +274,18 @@ def if_wordsize( ws, f ):
 
 # ---
 
+def if_in_tree_compiler( f ):
+    if config.in_tree_compiler:
+        return f
+    else:
+        return normal
+
+def unless_in_tree_compiler( f ):
+    if config.in_tree_compiler:
+        return normal
+    else:
+        return f
+
 def if_compiler_type( compiler, f ):
     if config.compiler_type == compiler:
         return f
index 9d3f497..d057281 100644 (file)
@@ -59,6 +59,7 @@ STAGE3_GHC := $(abspath $(TOP)/../inplace/bin/ghc-stage3)
 
 ifneq "$(wildcard $(STAGE1_GHC) $(STAGE1_GHC).exe)" ""
 
+IN_TREE_COMPILER = YES
 ifeq "$(BINDIST)" "YES"
 TEST_HC := $(abspath $(TOP)/../)/bindisttest/install dir/bin/ghc
 else ifeq "$(stage)" "1"
@@ -71,6 +72,7 @@ TEST_HC := $(STAGE2_GHC)
 endif
 
 else
+IN_TREE_COMPILER = NO
 TEST_HC := $(shell which ghc)
 endif
 
index 36756d7..09c670b 100644 (file)
@@ -91,6 +91,12 @@ else
 RUNTEST_OPTS += -e windows=False
 endif
 
+ifeq "$(IN_TREE_COMPILER)" "YES"
+RUNTEST_OPTS += -e in_tree_compiler=True
+else
+RUNTEST_OPTS += -e in_tree_compiler=False
+endif
+
 ifneq "$(THREADS)" ""
 RUNTEST_OPTS += --threads=$(THREADS)
 endif
index c7a7b27..9894eca 100644 (file)
@@ -43,7 +43,7 @@ test('2783', [ omit_ways(['ghci']), exit_code(1) ], compile_and_run, [''])
 
 # Test the work-stealing deque implementation.  We run this test in
 # both threaded1 (-threaded -debug) and threaded2 (-threaded) ways.
-test('testwsdeque', [
+test('testwsdeque', [unless_in_tree_compiler(skip),
                     c_src, only_ways(['threaded1', 'threaded2'])],
                     compile_and_run, ['-I../../../../rts'])