summaryrefslogtreecommitdiff
path: root/testsuite/tests/ghc-e
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2016-06-24 20:45:04 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2016-06-29 18:20:51 +0200
commit1084d3755cac6ccd90f8decc0d79c315387ae388 (patch)
treea71d2acd5aa581d9c4edea6969edc3d0afc3447f /testsuite/tests/ghc-e
parent8f7194fae23bdc6db72fc5784933f50310ce51f9 (diff)
downloadhaskell-1084d3755cac6ccd90f8decc0d79c315387ae388.tar.gz
Testsuite: use ignore_stderr/stdout instead of ignore_output
The problem with ignore_output is that it hides errors for WAY=ghci. GHCi always returns with exit code 0 (unless it is broken itself). For example: ghci015 must have been failing with compile errors for years, but we didn't notice because all output was ignored. Therefore, replace all uses of ignore_output with either ignore_stderr or ignore_stdout. In some cases I opted for adding the expected output. Update submodule hpc and stm. Reviewed by: simonmar Differential Revision: https://phabricator.haskell.org/D2367
Diffstat (limited to 'testsuite/tests/ghc-e')
-rw-r--r--testsuite/tests/ghc-e/should_fail/Makefile14
-rw-r--r--testsuite/tests/ghc-e/should_fail/T7962.stderr3
-rw-r--r--testsuite/tests/ghc-e/should_fail/T9905fail1.stderr4
-rw-r--r--testsuite/tests/ghc-e/should_fail/T9905fail2.stderr3
-rw-r--r--testsuite/tests/ghc-e/should_fail/T9905fail3.stderr2
-rw-r--r--testsuite/tests/ghc-e/should_fail/T9930fail.stderr2
-rw-r--r--testsuite/tests/ghc-e/should_fail/all.T14
-rw-r--r--testsuite/tests/ghc-e/should_fail/ghc-e-fail1.stderr3
-rw-r--r--testsuite/tests/ghc-e/should_fail/ghc-e-fail2.stderr4
9 files changed, 35 insertions, 14 deletions
diff --git a/testsuite/tests/ghc-e/should_fail/Makefile b/testsuite/tests/ghc-e/should_fail/Makefile
index 9aa7c07fa5..827dfc776a 100644
--- a/testsuite/tests/ghc-e/should_fail/Makefile
+++ b/testsuite/tests/ghc-e/should_fail/Makefile
@@ -3,22 +3,22 @@ include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
T7962:
- '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "return ("
+ -'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "return ("
T9905fail1:
- '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "import This.Module.Does.Not.Exist"
+ -'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "import This.Module.Does.Not.Exist"
T9905fail2:
- '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "import Data.List (bogusIdentifier)"
+ -'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "import Data.List (bogusIdentifier)"
T9905fail3:
- '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "import Prelude (+)" # syntax error
+ -'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "import Prelude (+)" # syntax error
ghc-e-fail1:
- '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "class ["
+ -'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "class ["
ghc-e-fail2:
- '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "type A = A"
+ -'$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -e "type A = A"
T9930fail:
- '$(TEST_HC)' $(TEST_HC_OPTS) -ignore-dot-ghci -x hs T9930
+ -'$(TEST_HC)' $(TEST_HC_OPTS) -v0 -x hs T9930
diff --git a/testsuite/tests/ghc-e/should_fail/T7962.stderr b/testsuite/tests/ghc-e/should_fail/T7962.stderr
new file mode 100644
index 0000000000..b58aa89502
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_fail/T7962.stderr
@@ -0,0 +1,3 @@
+
+<interactive>:0:9: error:
+ parse error (possibly incorrect indentation or mismatched brackets)
diff --git a/testsuite/tests/ghc-e/should_fail/T9905fail1.stderr b/testsuite/tests/ghc-e/should_fail/T9905fail1.stderr
new file mode 100644
index 0000000000..1f0fb05138
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_fail/T9905fail1.stderr
@@ -0,0 +1,4 @@
+
+<no location info>: error:
+ Could not find module ‘This.Module.Does.Not.Exist’
+ It is not a module in the current program, or in any known package.
diff --git a/testsuite/tests/ghc-e/should_fail/T9905fail2.stderr b/testsuite/tests/ghc-e/should_fail/T9905fail2.stderr
new file mode 100644
index 0000000000..2e3e2d94cc
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_fail/T9905fail2.stderr
@@ -0,0 +1,3 @@
+
+<interactive>:1:19: error:
+ Module ‘Data.List’ does not export ‘bogusIdentifier’
diff --git a/testsuite/tests/ghc-e/should_fail/T9905fail3.stderr b/testsuite/tests/ghc-e/should_fail/T9905fail3.stderr
new file mode 100644
index 0000000000..85226ea2b4
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_fail/T9905fail3.stderr
@@ -0,0 +1,2 @@
+
+<interactive>:0:17: error: parse error on input ‘+’
diff --git a/testsuite/tests/ghc-e/should_fail/T9930fail.stderr b/testsuite/tests/ghc-e/should_fail/T9930fail.stderr
new file mode 100644
index 0000000000..a76a467f89
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_fail/T9930fail.stderr
@@ -0,0 +1,2 @@
+ghc-stage2: default output name would overwrite the input file; must specify -o explicitly
+Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/ghc-e/should_fail/all.T b/testsuite/tests/ghc-e/should_fail/all.T
index 8cb6d9a68b..c4baa0f3d4 100644
--- a/testsuite/tests/ghc-e/should_fail/all.T
+++ b/testsuite/tests/ghc-e/should_fail/all.T
@@ -1,22 +1,22 @@
-test('T7962', [exit_code(2), req_interp, ignore_output], run_command,
+test('T7962', req_interp, run_command,
['$MAKE --no-print-directory -s T7962'])
-test('T9905fail1', [exit_code(2), req_interp, ignore_output], run_command,
+test('T9905fail1', req_interp, run_command,
['$MAKE --no-print-directory -s T9905fail1'])
-test('T9905fail2', [exit_code(2), req_interp, ignore_output], run_command,
+test('T9905fail2', req_interp, run_command,
['$MAKE --no-print-directory -s T9905fail2'])
-test('T9905fail3', [exit_code(2), req_interp, ignore_output], run_command,
+test('T9905fail3', req_interp, run_command,
['$MAKE --no-print-directory -s T9905fail3'])
-test('ghc-e-fail1', [exit_code(2), req_interp, ignore_output], run_command,
+test('ghc-e-fail1', req_interp, run_command,
['$MAKE --no-print-directory -s ghc-e-fail1'])
-test('ghc-e-fail2', [exit_code(2), req_interp, ignore_output], run_command,
+test('ghc-e-fail2', req_interp, run_command,
['$MAKE --no-print-directory -s ghc-e-fail2'])
# Don't run on Windows, as executable is written to T9930.exe
# and no failure is induced.
-test('T9930fail', [exit_code(2), ignore_output, when(opsys('mingw32'), skip)], run_command,
+test('T9930fail', when(opsys('mingw32'), skip), run_command,
['$MAKE --no-print-directory -s T9930fail'])
diff --git a/testsuite/tests/ghc-e/should_fail/ghc-e-fail1.stderr b/testsuite/tests/ghc-e/should_fail/ghc-e-fail1.stderr
new file mode 100644
index 0000000000..cf75b40644
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_fail/ghc-e-fail1.stderr
@@ -0,0 +1,3 @@
+
+<interactive>:0:8: error:
+ parse error (possibly incorrect indentation or mismatched brackets)
diff --git a/testsuite/tests/ghc-e/should_fail/ghc-e-fail2.stderr b/testsuite/tests/ghc-e/should_fail/ghc-e-fail2.stderr
new file mode 100644
index 0000000000..bcd0565d6a
--- /dev/null
+++ b/testsuite/tests/ghc-e/should_fail/ghc-e-fail2.stderr
@@ -0,0 +1,4 @@
+
+<interactive>:0:1: error:
+ Cycle in type synonym declarations:
+ <interactive>:0:1-10: type A = A