summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFacundo Domínguez <facundo.dominguez@tweag.io>2017-02-09 23:20:17 -0300
committerFacundo Domínguez <facundo.dominguez@tweag.io>2017-02-09 23:20:17 -0300
commit969bc7be4a26bf46bce0cf2a22b8487e3bb45dc4 (patch)
treeb2c5ff58ed8a325c9b9cb3240f4beb41faabb5ee
parenta6a4d0e1b558166c87b4f60500855fcd5f088f7c (diff)
downloadhaskell-fd/fix-travis.tar.gz
Relax test TH_addCStub2 so it succeeds on travis.fd/fix-travis
-rw-r--r--testsuite/tests/th/TH_addCStub2.stderr5
-rw-r--r--testsuite/tests/th/all.T11
2 files changed, 10 insertions, 6 deletions
diff --git a/testsuite/tests/th/TH_addCStub2.stderr b/testsuite/tests/th/TH_addCStub2.stderr
index ba3277b277..50951036c9 100644
--- a/testsuite/tests/th/TH_addCStub2.stderr
+++ b/testsuite/tests/th/TH_addCStub2.stderr
@@ -1,6 +1 @@
-
TH_addCStub2.hs:13:13:
- expected ‘;’, ‘,’ or ‘)’ before ‘{’ token
- [ "#include <stdio.h>"
- ^
-`gcc' failed in phase `C Compiler'. (Exit code: 1)
diff --git a/testsuite/tests/th/all.T b/testsuite/tests/th/all.T
index 9a08b6542c..f710089723 100644
--- a/testsuite/tests/th/all.T
+++ b/testsuite/tests/th/all.T
@@ -63,8 +63,17 @@ test('TH_reifyDecl2', normal, compile, ['-v0'])
test('TH_reifyLocalDefs', normal, compile, ['-v0'])
test('TH_reifyLocalDefs2', normal, compile, ['-v0'])
+
+# Filters the output of an appended command with the given pattern.
+def grep_stderr_of(pattern):
+ swap12 = '3>&1 1>&2 2>&3 3>&-' # Swap file descriptors 1 and 2.
+ # pipefail: fail if the command fails
+ return('bash -o pipefail -c \'"$@" {swap12} | grep {pattern} {swap12}\' --'.format(**locals()))
+
test('TH_addCStub1', normal, compile_and_run, ['-v0'])
-test('TH_addCStub2', normal, compile_fail, ['-v0'])
+test('TH_addCStub2',
+ [normal, compile_cmd_prefix(grep_stderr_of('TH_addCStub2.hs:13:13:'))]
+ , compile_fail, ['-v0'])
test('TH_reifyMkName', normal, compile, ['-v0'])