Permalink
Browse files

Only run dynamicToo001 if we have both vanilla and dynamic libraries

  • Loading branch information...
1 parent 9f1f5ff commit 890fea060ec8507f31f3ff212aaf8b56a80b1671 @igfoo igfoo committed Dec 14, 2012
Showing with 57 additions and 6 deletions.
  1. +3 −0 config/ghc
  2. +3 −0 driver/testglobals.py
  3. +36 −0 driver/testlib.py
  4. +8 −1 mk/test.mk
  5. +7 −5 tests/driver/dynamicToo/all.T
View
3 config/ghc
@@ -40,6 +40,9 @@ config.compiler_debugged = ghc_debugged
if (ghc_with_vanilla == 1):
config.have_vanilla = True
+if (ghc_with_dynamic == 1):
+ config.have_dynamic = True
+
if (ghc_with_profiling == 1):
config.have_profiling = True
config.compile_ways.append('profasm')
View
3 driver/testglobals.py
@@ -81,6 +81,9 @@ def __init__(self):
# Do we have vanilla libraries?
self.have_vanilla = False
+ # Do we have dynamic libraries?
+ self.have_dynamic = False
+
# Do we have profiling support?
self.have_profiling = False
View
36 driver/testlib.py
@@ -354,6 +354,42 @@ def if_cygwin( f ):
else:
return normal
+def when_have_vanilla( f ):
+ if config.have_vanilla:
+ return f
+ else:
+ return normal
+
+def unless_have_vanilla( f ):
+ if config.have_vanilla:
+ return normal
+ else:
+ return f
+
+def when_have_dynamic( f ):
+ if config.have_dynamic:
+ return f
+ else:
+ return normal
+
+def unless_have_dynamic( f ):
+ if config.have_dynamic:
+ return normal
+ else:
+ return f
+
+def when_have_profiling( f ):
+ if config.have_profiling:
+ return f
+ else:
+ return normal
+
+def unless_have_profiling( f ):
+ if config.have_profiling:
+ return normal
+ else:
+ return f
+
# ---
def if_ghci_dynamic( f ):
View
9 mk/test.mk
@@ -49,14 +49,21 @@ endif
BASE_LIBDIR := $(shell "$(GHC_PKG)" field base library-dirs | sed 's/^[^:]*: *//')
HAVE_VANILLA := $(shell if [ -f $(subst \,/,$(BASE_LIBDIR))/Prelude.hi ]; then echo YES; else echo NO; fi)
-HAVE_PROFILING := $(shell if [ -f $(subst \,/,$(BASE_LIBDIR))/Prelude.p_a ]; then echo YES; else echo NO; fi)
+HAVE_DYNAMIC := $(shell if [ -f $(subst \,/,$(BASE_LIBDIR))/Prelude.dyn_hi ]; then echo YES; else echo NO; fi)
+HAVE_PROFILING := $(shell if [ -f $(subst \,/,$(BASE_LIBDIR))/Prelude.p_hi ]; then echo YES; else echo NO; fi)
ifeq "$(HAVE_VANILLA)" "YES"
RUNTEST_OPTS += -e ghc_with_vanilla=1
else
RUNTEST_OPTS += -e ghc_with_vanilla=0
endif
+ifeq "$(HAVE_DYNAMIC)" "YES"
+RUNTEST_OPTS += -e ghc_with_dynamic=1
+else
+RUNTEST_OPTS += -e ghc_with_dynamic=0
+endif
+
ifeq "$(HAVE_PROFILING)" "YES"
RUNTEST_OPTS += -e ghc_with_profiling=1
else
View
12 tests/driver/dynamicToo/all.T
@@ -1,11 +1,13 @@
setTestOpts(only_compiler_types(['ghc']))
test('dynamicToo001',
- extra_clean(['A001.o', 'B001.o', 'C001.o',
- 'A001.hi', 'B001.hi', 'C001.hi',
- 'A001.dyn_o', 'B001.dyn_o', 'C001.dyn_o',
- 'A001.dyn_hi', 'B001.dyn_hi', 'C001.dyn_hi',
- 's001', 'd001']),
+ [extra_clean(['A001.o', 'B001.o', 'C001.o',
+ 'A001.hi', 'B001.hi', 'C001.hi',
+ 'A001.dyn_o', 'B001.dyn_o', 'C001.dyn_o',
+ 'A001.dyn_hi', 'B001.dyn_hi', 'C001.dyn_hi',
+ 's001', 'd001']),
+ unless_have_vanilla(skip),
+ unless_have_dynamic(skip)],
run_command,
['$MAKE -s --no-print-directory dynamicToo001'])

0 comments on commit 890fea0

Please sign in to comment.