Commit d5d04c88 authored by Ian Lynagh's avatar Ian Lynagh

Allow tests to behave differently depending on whether the compiler is in-tree

And skip testwsdeque if it is not in-tree, as we rely on some headers
from the build tree.
parent 3688af80
......@@ -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'],
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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'])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment