Commit 7d5fee1c authored by simonmar's avatar simonmar
Browse files

[project @ 2002-12-02 14:48:27 by simonmar]

Add support for multi-module tests in GHCi
parent cd73b722
......@@ -400,7 +400,7 @@ def compile_and_run( name, way, extra_hc_opts ):
pretest_cleanup(name)
if way == 'ghci': # interpreted...
return interpreter_run( name, way, extra_hc_opts, 0 )
return interpreter_run( name, way, extra_hc_opts, 0, '' )
else: # compiled...
result = simple_build( name, way, extra_hc_opts, 0, '', 1 )
......@@ -413,7 +413,11 @@ def compile_and_run( name, way, extra_hc_opts ):
def multimod_compile_and_run( name, way, top_mod, extra_hc_opts ):
pretest_cleanup(name)
result = simple_build( name, way, extra_hc_opts, 0, top_mod, 1 )
if way == 'ghci': # interpreted...
return interpreter_run( name, way, extra_hc_opts, 0, top_mod )
else: # compiled...
result = simple_build( name, way, extra_hc_opts, 0, top_mod, 1 )
if result != 0:
return 'fail'
......@@ -514,15 +518,18 @@ def simple_run( name ):
# -----------------------------------------------------------------------------
# Run a program in the interpreter and check its output
def interpreter_run( name, way, extra_hc_opts, compile_only ):
def interpreter_run( name, way, extra_hc_opts, compile_only, top_mod ):
outname = add_suffix(name, 'interp.stdout')
errname = add_suffix(name, 'interp.stderr')
rm_no_fail(outname)
rm_no_fail(errname)
rm_no_fail(name)
srcname = add_suffix(name, 'hs')
if (top_mod == ''):
srcname = add_suffix(name, 'hs')
else:
srcname = top_mod
scriptname = add_suffix(name, 'script')
qscriptname = in_testdir(scriptname)
rm_no_fail(qscriptname)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment