[commit: ghc] wip/tdammers/disable-defer-type-errors-ghci: testsuite: allow passing extra_hc_options to ghci (a4ab3b7)
git at git.haskell.org
git at git.haskell.org
Tue Jun 12 10:41:09 UTC 2018
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/tdammers/disable-defer-type-errors-ghci
Link : http://ghc.haskell.org/trac/ghc/changeset/a4ab3b774a035d420306a51aa936214e2d0cf2d0/ghc
>---------------------------------------------------------------
commit a4ab3b774a035d420306a51aa936214e2d0cf2d0
Author: Tobias Dammers <tdammers at gmail.com>
Date: Tue Jun 12 12:38:26 2018 +0200
testsuite: allow passing extra_hc_options to ghci
We need this in order to test passing flags to ghci externally vs. via a
:set command.
>---------------------------------------------------------------
a4ab3b774a035d420306a51aa936214e2d0cf2d0
testsuite/driver/testlib.py | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/testsuite/driver/testlib.py b/testsuite/driver/testlib.py
index 3bae765..17029e1 100644
--- a/testsuite/driver/testlib.py
+++ b/testsuite/driver/testlib.py
@@ -963,14 +963,14 @@ def run_command( name, way, cmd ):
# -----------------------------------------------------------------------------
# GHCi tests
-def ghci_script( name, way, script):
+def ghci_script( name, way, script, extra_hc_opts='' ):
flags = ' '.join(get_compiler_flags())
way_flags = ' '.join(config.way_flags[way])
# We pass HC and HC_OPTS as environment variables, so that the
# script can invoke the correct compiler by using ':! $HC $HC_OPTS'
- cmd = ('HC={{compiler}} HC_OPTS="{flags}" {{compiler}} {flags} {way_flags}'
- ).format(flags=flags, way_flags=way_flags)
+ cmd = ('HC={{compiler}} HC_OPTS="{flags}" {{compiler}} {flags} {way_flags} {extra_hc_opts}'
+ ).format(flags=flags, way_flags=way_flags, extra_hc_opts=extra_hc_opts)
getTestOpts().stdin = script
return simple_run( name, way, cmd, getTestOpts().extra_run_opts )
More information about the ghc-commits
mailing list