summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghci
diff options
context:
space:
mode:
authorIan Lynagh <ian@well-typed.com>2013-02-03 18:41:55 +0000
committerIan Lynagh <ian@well-typed.com>2013-02-03 18:45:30 +0000
commit8005af165c5974ddd92ea017f1ce6b41465c0c7f (patch)
tree17ef47a0d1a7b65cd64ad9f722dfc853f938729c /testsuite/tests/ghci
parent6eb328b50343459a2aa849ae036ce26addd84e67 (diff)
downloadhaskell-8005af165c5974ddd92ea017f1ce6b41465c0c7f.tar.gz
Use a proper executable (rather than a shell script) in T6106
Fixes the test on Windows
Diffstat (limited to 'testsuite/tests/ghci')
-rw-r--r--testsuite/tests/ghci/scripts/Makefile5
-rw-r--r--testsuite/tests/ghci/scripts/T6106.script2
-rw-r--r--testsuite/tests/ghci/scripts/T6106_preproc.hs17
-rwxr-xr-xtestsuite/tests/ghci/scripts/T6106_preproc.sh7
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T8
5 files changed, 30 insertions, 9 deletions
diff --git a/testsuite/tests/ghci/scripts/Makefile b/testsuite/tests/ghci/scripts/Makefile
index 1fe702567f..73f62036d7 100644
--- a/testsuite/tests/ghci/scripts/Makefile
+++ b/testsuite/tests/ghci/scripts/Makefile
@@ -34,3 +34,8 @@ ghci037:
ghci056_setup:
'$(TEST_HC)' $(TEST_HC_OPTS) -c ghci056_c.c
+
+.PHONY: T6106_prep
+T6106_prep:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -v0 --make T6106_preproc
+
diff --git a/testsuite/tests/ghci/scripts/T6106.script b/testsuite/tests/ghci/scripts/T6106.script
index 1b071ec604..be6de46362 100644
--- a/testsuite/tests/ghci/scripts/T6106.script
+++ b/testsuite/tests/ghci/scripts/T6106.script
@@ -3,7 +3,7 @@
:l
:shell rm -f T6106.hs
-:shell echo "{-# OPTIONS_GHC -F -pgmF ./T6106_preproc.sh #-}" >T6106.hs
+:shell echo "{-# OPTIONS_GHC -F -pgmF ./T6106_preproc #-}" >T6106.hs
:shell echo "module T6106 where" >>T6106.hs
:load T6106.hs
-- second one should fail:
diff --git a/testsuite/tests/ghci/scripts/T6106_preproc.hs b/testsuite/tests/ghci/scripts/T6106_preproc.hs
new file mode 100644
index 0000000000..fd2a55a646
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T6106_preproc.hs
@@ -0,0 +1,17 @@
+
+import Control.Concurrent
+import Data.ByteString as BS
+import System.Environment
+
+main :: IO ()
+main = do args <- getArgs
+ case args of
+ [x, y, z] -> f x y z
+ _ -> error ("Bad args: " ++ show args)
+
+f :: String -> String -> String -> IO ()
+f x y z = do bs <- BS.readFile y
+ BS.writeFile z bs
+ threadDelay 1000000
+ Prelude.writeFile x "FAIL"
+
diff --git a/testsuite/tests/ghci/scripts/T6106_preproc.sh b/testsuite/tests/ghci/scripts/T6106_preproc.sh
deleted file mode 100755
index 56ca6082f6..0000000000
--- a/testsuite/tests/ghci/scripts/T6106_preproc.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/bin/sh
-#
-# file T6106_preproc.sh
-#
-cat $2 > $3
-sleep 1
-echo "FAIL" >$1
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index 659a275660..b4dd4481c5 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -128,7 +128,13 @@ test('T6027ghci', normal, ghci_script, ['T6027ghci.script'])
test('T6007', normal, ghci_script, ['T6007.script'])
test('T6091', normal, ghci_script, ['T6091.script'])
-test('T6106', extra_clean(['T6106.hs']), ghci_script, ['T6106.script'])
+test('T6106',
+ [extra_clean(['T6106.hs',
+ 'T6106_preproc.hi', 'T6106_preproc.o',
+ 'T6106_preproc', 'T6106_preproc.exe']),
+ pre_cmd('$MAKE -s --no-print-directory T6106_prep')],
+ ghci_script,
+ ['T6106.script'])
test('T6105', normal, ghci_script, ['T6105.script'])
test('T7117', normal, ghci_script, ['T7117.script'])
test('ghci058',