summaryrefslogtreecommitdiff
path: root/testsuite/tests/stranal
diff options
context:
space:
mode:
authorJoachim Breitner <mail@joachim-breitner.de>2017-09-10 15:49:43 +0100
committerJoachim Breitner <mail@joachim-breitner.de>2017-09-12 10:59:50 -0400
commitfe35b85a8cc72582e0f98a3059be00a9a2318a4a (patch)
tree97f07df4e36800e9a8e294ee9f683f8dbf2be730 /testsuite/tests/stranal
parent838a10fcad9168895b49b4709056b549f2888860 (diff)
downloadhaskell-fe35b85a8cc72582e0f98a3059be00a9a2318a4a.tar.gz
Add testcase for #14186
and move the generally useful helpers check_errmsg and grep_errmsg to testlib.py. Some documentation can be found on https://ghc.haskell.org/trac/ghc/wiki/Building/RunningTests/Adding
Diffstat (limited to 'testsuite/tests/stranal')
-rw-r--r--testsuite/tests/stranal/should_compile/all.T21
1 files changed, 4 insertions, 17 deletions
diff --git a/testsuite/tests/stranal/should_compile/all.T b/testsuite/tests/stranal/should_compile/all.T
index d8fc7575cd..4421b24a6e 100644
--- a/testsuite/tests/stranal/should_compile/all.T
+++ b/testsuite/tests/stranal/should_compile/all.T
@@ -1,19 +1,6 @@
# Only compile with optimisation
setTestOpts( only_ways(['optasm']) )
-def checkCoreString(needle):
- def norm(str):
- if needle in str:
- return "%s contained in -ddump-simpl\n" % needle
- else:
- return "%s not contained in -ddump-simpl\n" % needle
- return normalise_errmsg_fun(norm)
-
-def grepCoreString(needle):
- def norm(str):
- return "".join(filter(lambda l: re.search(needle, l), str.splitlines(True)))
- return normalise_errmsg_fun(norm)
-
test('default', normal, compile, [''])
test('fact', normal, compile, [''])
test('fun', normal, compile, [''])
@@ -39,15 +26,15 @@ test('T8743', [], multimod_compile, ['T8743', '-v0'])
# with two unboxed args. See Trac #10482 for background
#
# Set -dppr-cols to ensure output doesn't wrap
-test('T10482', [ grepCoreString(r'wfoo.*Int#') ], compile, ['-dppr-cols=200 -ddump-simpl'])
-test('T10482a', [ grepCoreString(r'wf.*Int#') ], compile, ['-dppr-cols=200 -ddump-simpl'])
+test('T10482', [ grep_errmsg(r'wfoo.*Int#') ], compile, ['-dppr-cols=200 -ddump-simpl'])
+test('T10482a', [ grep_errmsg(r'wf.*Int#') ], compile, ['-dppr-cols=200 -ddump-simpl'])
test('T9208', when(compiler_debugged(), expect_broken(9208)), compile, [''])
# T9208 fails (and should do so) if you have assertion checking on in the compiler
# Hence the above expect_broken. See comments in the Trac ticket
-test('T10694', [ grepCoreString(r'Str=') ], compile, ['-dppr-cols=200 -ddump-simpl'])
-test('T11770', [ checkCoreString('OneShot') ], compile, ['-ddump-simpl'])
+test('T10694', [ grep_errmsg(r'Str=') ], compile, ['-dppr-cols=200 -ddump-simpl'])
+test('T11770', [ check_errmsg('OneShot') ], compile, ['-ddump-simpl'])
test('T13031', normal, run_command,
['$MAKE -s --no-print-directory T13031'])