summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-e/should_run
diff options
context:
space:
mode:
authorHerbert Valerio Riedel <hvr@gnu.org>2014-01-12 11:40:09 +0100
committerHerbert Valerio Riedel <hvr@gnu.org>2014-01-12 12:47:17 +0100
commit66693401b98cb5aa912948af7bbd2182474f50c4 (patch)
treeab176320c561668c9ac13e684c9cc8ae6e4535f6 /testsuite/tests/ghc-e/should_run
parenta924debcbb3dc5c004f988fcc1b480a01ba276dd (diff)
parentad233cf68ea436c84e931c5bdb9f803308708e09 (diff)
downloadhaskell-66693401b98cb5aa912948af7bbd2182474f50c4.tar.gz
Fold testsuite.git into ghc.git (re #8545)
This commit performs a subtree merge of testsuite.git into ghc.git; The next commit will adapt `sync-all` et al. to the new situation. At the time of merge, testsuite.git was at commit [998a816ae89c4fd573f4abd7c6abb346cf7ee9af/testsuite] The following steps have been used to accomplish this merge: 1. Clone a fresh testsuite.git copy (& cd into) 2. Remove accidentally committed binary files from history git filter-branch \ --index-filter "git rm -r --cached --ignore-unmatch \ tests/haddock/should_compile_flag_nohaddock/a.out \ tests/haddock/should_compile_noflag_nohaddock/a.out \ tests/ghc-regress/haddock/should_compile_flag_nohaddock/a.out \ tests/ghc-regress/haddock/should_compile_noflag_nohaddock/a.out \ tests/ghc-regress/dph/diophantine/dph-diophantine-fast \ tests/ghc-regress/dph/diophantine/dph-diophantine-opt \ tests/ghc-regress/dph/primespj/dph-primespj-fast \ tests/ghc-regress/dph/quickhull/dph-quickhull-fast \ tests/ghc-regress/dph/smvm/dph-smvm \ tests/ghc-regress/dph/sumnats/dph-sumnats \ tests/ghc-regress/dph/words/dph-words-fast \ tests/ghc-regress/plugins/plugins01" \ HEAD 3. Rename all paths in testsuite.git to be prefixed with `testsuite/` git filter-branch -f --prune-empty --tree-filter \ "mkdir -p testsuite; \ git ls-tree --name-only \$GIT_COMMIT | xargs -I files mv files testsuite/" 4. cd into ghc/ checkout, and perform subtree merge of testsuite into ghc (see also http://nuclearsquid.com/writings/subtree-merging-and-you/) cd ../ghc/ git remote add -f testsuite ../testsuite/.git git merge -s ours --no-commit testsuite/master git read-tree --prefix=/ -u testsuite/master git commit Signed-off-by: Herbert Valerio Riedel <hvr@gnu.org>
Diffstat (limited to 'testsuite/tests/ghc-e/should_run')
-rw-r--r--testsuite/tests/ghc-e/should_run/Makefile32
-rw-r--r--testsuite/tests/ghc-e/should_run/T2228.hs4
-rw-r--r--testsuite/tests/ghc-e/should_run/T2228.stdout2
-rw-r--r--testsuite/tests/ghc-e/should_run/T2636.hs2
-rw-r--r--testsuite/tests/ghc-e/should_run/T2636.stderr4
-rw-r--r--testsuite/tests/ghc-e/should_run/T3890.hs9
-rw-r--r--testsuite/tests/ghc-e/should_run/T3890.stdout1
-rw-r--r--testsuite/tests/ghc-e/should_run/all.T16
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e002.hs3
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e002.stdout1
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e003.stdout2
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e004.stdout1
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e005.hs13
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e005.stderr1
-rw-r--r--testsuite/tests/ghc-e/should_run/ghc-e005.stdout3
15 files changed, 94 insertions, 0 deletions
diff --git a/testsuite/tests/ghc-e/should_run/Makefile b/testsuite/tests/ghc-e/should_run/Makefile
new file mode 100644
index 0000000000..1971004d4c
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/Makefile
@@ -0,0 +1,32 @@
+TOP=../../..
+include $(TOP)/mk/boilerplate.mk
+include $(TOP)/mk/test.mk
+
+ghc-e001:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "return ()"
+
+ghc-e002:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":main" ghc-e002.hs
+
+ghc-e003:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e 'putStrLn "Foo"' -e 'putStrLn "Bar"'
+
+ghc-e004:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":m + System.Exit" -e "exitWith (ExitFailure 6)"; echo $$?
+
+# This is what runghc does:
+ghc-e005:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -main-is foo ghc-e005.hs -e ":set prog ghc-e005-prog" -e ":main [\"the\",\"args\"]"; echo $$?
+
+T2228:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":main" T2228.hs
+
+T2636:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":main" T2636.hs; if [ "$?" != 0 ]; then true; else false; fi
+
+T3890:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e ":main" T3890.hs | cat
+
+T7299:
+ '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "Control.Concurrent.threadDelay (1000 * 1000)"
+
diff --git a/testsuite/tests/ghc-e/should_run/T2228.hs b/testsuite/tests/ghc-e/should_run/T2228.hs
new file mode 100644
index 0000000000..0c53c5ae13
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/T2228.hs
@@ -0,0 +1,4 @@
+import System.IO
+main = do
+ hGetBuffering stdin >>= print
+ hGetBuffering stdout >>= print
diff --git a/testsuite/tests/ghc-e/should_run/T2228.stdout b/testsuite/tests/ghc-e/should_run/T2228.stdout
new file mode 100644
index 0000000000..07576b5a74
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/T2228.stdout
@@ -0,0 +1,2 @@
+BlockBuffering Nothing
+BlockBuffering Nothing
diff --git a/testsuite/tests/ghc-e/should_run/T2636.hs b/testsuite/tests/ghc-e/should_run/T2636.hs
new file mode 100644
index 0000000000..9c6694955a
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/T2636.hs
@@ -0,0 +1,2 @@
+import MissingModule
+main = print "main"
diff --git a/testsuite/tests/ghc-e/should_run/T2636.stderr b/testsuite/tests/ghc-e/should_run/T2636.stderr
new file mode 100644
index 0000000000..dbe70becec
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/T2636.stderr
@@ -0,0 +1,4 @@
+
+T2636.hs:1:8:
+ Could not find module ‛MissingModule’
+ Use -v to see a list of the files searched for.
diff --git a/testsuite/tests/ghc-e/should_run/T3890.hs b/testsuite/tests/ghc-e/should_run/T3890.hs
new file mode 100644
index 0000000000..a72e5c82a0
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/T3890.hs
@@ -0,0 +1,9 @@
+module Main (main) where
+
+import System.Exit
+import System.IO
+
+main :: IO ()
+main = do putStrLn "Q1"
+ exitFailure
+ putStrLn "Q2"
diff --git a/testsuite/tests/ghc-e/should_run/T3890.stdout b/testsuite/tests/ghc-e/should_run/T3890.stdout
new file mode 100644
index 0000000000..7e6c303ad6
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/T3890.stdout
@@ -0,0 +1 @@
+Q1
diff --git a/testsuite/tests/ghc-e/should_run/all.T b/testsuite/tests/ghc-e/should_run/all.T
new file mode 100644
index 0000000000..4ab7567358
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/all.T
@@ -0,0 +1,16 @@
+
+setTestOpts(when(compiler_profiled(), skip))
+
+test('ghc-e001', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e001'])
+test('ghc-e002', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e002'])
+test('ghc-e003', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e003'])
+test('ghc-e004', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e004'])
+test('ghc-e005', req_interp, run_command, ['$MAKE --no-print-directory -s ghc-e005'])
+
+test('T2228',
+ [req_interp, when(ghci_dynamic(), expect_broken(7298))],
+ run_command,
+ ['$MAKE --no-print-directory -s T2228'])
+test('T2636', req_interp, run_command, ['$MAKE --no-print-directory -s T2636'])
+test('T3890', req_interp, run_command, ['$MAKE --no-print-directory -s T3890'])
+test('T7299', req_interp, run_command, ['$MAKE --no-print-directory -s T7299'])
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e002.hs b/testsuite/tests/ghc-e/should_run/ghc-e002.hs
new file mode 100644
index 0000000000..028b1a0166
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e002.hs
@@ -0,0 +1,3 @@
+
+main :: IO ()
+main = putStrLn "This is main"
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e002.stdout b/testsuite/tests/ghc-e/should_run/ghc-e002.stdout
new file mode 100644
index 0000000000..23e1ebd03b
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e002.stdout
@@ -0,0 +1 @@
+This is main
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e003.stdout b/testsuite/tests/ghc-e/should_run/ghc-e003.stdout
new file mode 100644
index 0000000000..3b71d5be87
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e003.stdout
@@ -0,0 +1,2 @@
+Foo
+Bar
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e004.stdout b/testsuite/tests/ghc-e/should_run/ghc-e004.stdout
new file mode 100644
index 0000000000..1e8b314962
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e004.stdout
@@ -0,0 +1 @@
+6
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e005.hs b/testsuite/tests/ghc-e/should_run/ghc-e005.hs
new file mode 100644
index 0000000000..4899706d77
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e005.hs
@@ -0,0 +1,13 @@
+
+import System.Environment
+import System.IO
+
+main :: IO ()
+main = error "main got called"
+
+foo :: IO ()
+foo = do putStrLn "This is foo"
+ getArgs >>= print
+ hFlush stdout
+ error "foo"
+
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e005.stderr b/testsuite/tests/ghc-e/should_run/ghc-e005.stderr
new file mode 100644
index 0000000000..34cecca662
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e005.stderr
@@ -0,0 +1 @@
+ghc-e005-prog: foo
diff --git a/testsuite/tests/ghc-e/should_run/ghc-e005.stdout b/testsuite/tests/ghc-e/should_run/ghc-e005.stdout
new file mode 100644
index 0000000000..57cc51465d
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_run/ghc-e005.stdout
@@ -0,0 +1,3 @@
+This is foo
+["the","args"]
+1