summaryrefslogtreecommitdiff
path: root/libraries/base/tests
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2016-05-25 17:51:26 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2016-05-25 21:30:58 +0200
commitf07bf19ec49d25395dd47923ba5e6b525ce7e68f (patch)
tree74bec87a0fc0af7986aa0b4667fda0670e0dc6d2 /libraries/base/tests
parent6a5bce14ffb8b10def150b185fc95d7b2ebab263 (diff)
downloadhaskell-f07bf19ec49d25395dd47923ba5e6b525ce7e68f.tar.gz
Testsuite: fix enum01/02/03 on Windows (#9399)
Diffstat (limited to 'libraries/base/tests')
-rw-r--r--libraries/base/tests/all.T2
-rw-r--r--libraries/base/tests/enum01.hs2
-rw-r--r--libraries/base/tests/enum02.hs2
-rw-r--r--libraries/base/tests/enum03.hs2
-rwxr-xr-xlibraries/base/tests/enum_processor.bat11
-rw-r--r--[-rwxr-xr-x]libraries/base/tests/enum_processor.py2
6 files changed, 15 insertions, 6 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.