diff options
-rw-r--r-- | libraries/base/tests/all.T | 2 | ||||
-rw-r--r-- | libraries/base/tests/enum01.hs | 2 | ||||
-rw-r--r-- | libraries/base/tests/enum02.hs | 2 | ||||
-rw-r--r-- | libraries/base/tests/enum03.hs | 2 | ||||
-rwxr-xr-x | libraries/base/tests/enum_processor.bat | 11 | ||||
-rw-r--r--[-rwxr-xr-x] | libraries/base/tests/enum_processor.py | 2 | ||||
-rw-r--r-- | testsuite/driver/extra_files.py | 6 | ||||
-rw-r--r-- | testsuite/mk/test.mk | 2 |
8 files changed, 19 insertions, 10 deletions
diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T index fc97666c01..ac22336483 100644 --- a/libraries/base/tests/all.T +++ b/libraries/base/tests/all.T @@ -78,7 +78,7 @@ test('dynamic003', extra_run_opts('+RTS -K32m -RTS'), compile_and_run, [''] test('dynamic004', omit_ways(['normal', 'threaded1', 'ghci']), compile_and_run, ['']) test('dynamic005', normal, compile_and_run, ['']) -enum_setups = [when(fast(), skip), when(opsys('mingw32'), expect_broken(9399))] +enum_setups = [when(fast(), skip)] test('enum01', enum_setups, compile_and_run, ['']) test('enum02', enum_setups, compile_and_run, ['']) test('enum03', enum_setups, compile_and_run, ['']) diff --git a/libraries/base/tests/enum01.hs b/libraries/base/tests/enum01.hs index 0ae39b14d1..245f6f7105 100644 --- a/libraries/base/tests/enum01.hs +++ b/libraries/base/tests/enum01.hs @@ -1,5 +1,5 @@ -- !!! Testing the Prelude's Enum instances. -{-# OPTIONS_GHC -F -pgmF ./enum_processor.py #-} +{-# OPTIONS_GHC -F -pgmF ./enum_processor.bat #-} -- The processor is a non-CPP-based equivalent of -- #define printTest(x) (do{ putStr ( " " ++ "x" ++ " = " ) ; print (x) }) -- which is not portable to clang diff --git a/libraries/base/tests/enum02.hs b/libraries/base/tests/enum02.hs index f7e843c537..2d06f95f90 100644 --- a/libraries/base/tests/enum02.hs +++ b/libraries/base/tests/enum02.hs @@ -1,5 +1,5 @@ -- !!! Testing the Int Enum instances. -{-# OPTIONS_GHC -F -pgmF ./enum_processor.py #-} +{-# OPTIONS_GHC -F -pgmF ./enum_processor.bat #-} -- The processor is a non-CPP-based equivalent of -- #define printTest(x) (do{ putStr ( " " ++ "x" ++ " = " ) ; print (x) }) -- which is not portable to clang diff --git a/libraries/base/tests/enum03.hs b/libraries/base/tests/enum03.hs index 181354a5e5..28d02d1c13 100644 --- a/libraries/base/tests/enum03.hs +++ b/libraries/base/tests/enum03.hs @@ -1,5 +1,5 @@ -- !!! Testing the Word Enum instances. -{-# OPTIONS_GHC -F -pgmF ./enum_processor.py #-} +{-# OPTIONS_GHC -F -pgmF ./enum_processor.bat #-} -- The processor is a non-CPP-based equivalent of -- #define printTest(x) (do{ putStr ( " " ++ "x" ++ " = " ) ; print (x) }) -- which is not portable to clang diff --git a/libraries/base/tests/enum_processor.bat b/libraries/base/tests/enum_processor.bat new file mode 100755 index 0000000000..2b13a7db07 --- /dev/null +++ b/libraries/base/tests/enum_processor.bat @@ -0,0 +1,11 @@ +:;# Problem: GHC on Windows doesn't like '-pgmF ./enum_processor.py'. +:;# See ticket:365#comment:7 for details. +:;# +:;# Workaround: this file, which functions both as a Windows .bat script and a +:;# Unix shell script. Hacky, but it seems to work. + +:;# Starts with a ':', to skip on Windows. +:; "${PYTHON}" enum_processor.py $@; exit $? + +:;# Windows only: +%PYTHON% enum_processor.py %* diff --git a/libraries/base/tests/enum_processor.py b/libraries/base/tests/enum_processor.py index 53bea4cc9f..15243f11ff 100755..100644 --- a/libraries/base/tests/enum_processor.py +++ b/libraries/base/tests/enum_processor.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python - # The rough equivalent of the traditional CPP: # #define printTest(x) (do{ putStr ( " " ++ "x" ++ " = " ) ; print (x) }) # which is not portable to clang. diff --git a/testsuite/driver/extra_files.py b/testsuite/driver/extra_files.py index 0a2bfe6686..650ba45922 100644 --- a/testsuite/driver/extra_files.py +++ b/testsuite/driver/extra_files.py @@ -251,9 +251,9 @@ extra_src_files = { 'dynbrk004': ['../mdo.hs'], 'dynbrk005': ['TupleN.hs'], 'encoding004': ['encoded-data/'], - 'enum01': ['enum_processor.py'], - 'enum02': ['enum_processor.py'], - 'enum03': ['enum_processor.py'], + 'enum01': ['enum_processor.bat', 'enum_processor.py'], + 'enum02': ['enum_processor.bat', 'enum_processor.py'], + 'enum03': ['enum_processor.bat', 'enum_processor.py'], 'exampleTest': ['AnnotationTuple.hs'], 'fast2haskell': ['Fast2haskell.hs', 'Main.hs'], 'ffi018_ghci': ['ffi018.h'], diff --git a/testsuite/mk/test.mk b/testsuite/mk/test.mk index 4091b98ddd..d7e65bbf83 100644 --- a/testsuite/mk/test.mk +++ b/testsuite/mk/test.mk @@ -281,7 +281,7 @@ $(TIMEOUT_PROGRAM) : # communicate with the topmake. # See Note [Communicating options and variables to a submake] test: $(TIMEOUT_PROGRAM) - +$(PYTHON) $(RUNTESTS) $(RUNTEST_OPTS) \ + +PYTHON="$(PYTHON)" "$(PYTHON)" $(RUNTESTS) $(RUNTEST_OPTS) \ $(patsubst %, --only=%, $(TEST)) \ $(patsubst %, --only=%, $(TESTS)) \ $(patsubst %, --way=%, $(WAY)) \ |