From f07bf19ec49d25395dd47923ba5e6b525ce7e68f Mon Sep 17 00:00:00 2001 From: Thomas Miedema Date: Wed, 25 May 2016 17:51:26 +0200 Subject: Testsuite: fix enum01/02/03 on Windows (#9399) --- libraries/base/tests/all.T | 2 +- libraries/base/tests/enum01.hs | 2 +- libraries/base/tests/enum02.hs | 2 +- libraries/base/tests/enum03.hs | 2 +- libraries/base/tests/enum_processor.bat | 11 +++++++++++ libraries/base/tests/enum_processor.py | 2 -- 6 files changed, 15 insertions(+), 6 deletions(-) create mode 100755 libraries/base/tests/enum_processor.bat mode change 100755 => 100644 libraries/base/tests/enum_processor.py (limited to 'libraries/base/tests') 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 old mode 100755 new mode 100644 index 53bea4cc9f..15243f11ff --- 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. -- cgit v1.2.1