Commit bbde26bc authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Define and use opts in simple_run in the driver

parent 248918e6
...@@ -757,9 +757,11 @@ def simple_build( name, way, extra_hc_opts, should_fail, top_mod, link ): ...@@ -757,9 +757,11 @@ def simple_build( name, way, extra_hc_opts, should_fail, top_mod, link ):
# testname.run.stderr. Returns the exit code of the run. # testname.run.stderr. Returns the exit code of the run.
def simple_run( name, way, prog, args ): def simple_run( name, way, prog, args ):
opts = getTestOpts()
# figure out what to use for stdin # figure out what to use for stdin
if getTestOpts().stdin != '': if opts.stdin != '':
use_stdin = getTestOpts().stdin use_stdin = opts.stdin
else: else:
stdin_file = add_suffix(name, 'stdin') stdin_file = add_suffix(name, 'stdin')
if os.path.exists(in_testdir(stdin_file)): if os.path.exists(in_testdir(stdin_file)):
...@@ -778,7 +780,7 @@ def simple_run( name, way, prog, args ): ...@@ -778,7 +780,7 @@ def simple_run( name, way, prog, args ):
my_rts_flags = rts_flags(way) my_rts_flags = rts_flags(way)
if getTestOpts().no_stdin: if opts.no_stdin:
stdin_comes_from = '' stdin_comes_from = ''
else: else:
stdin_comes_from = ' <' + use_stdin stdin_comes_from = ' <' + use_stdin
...@@ -796,8 +798,8 @@ def simple_run( name, way, prog, args ): ...@@ -796,8 +798,8 @@ def simple_run( name, way, prog, args ):
signal = result & 0xff signal = result & 0xff
# check the exit code # check the exit code
if exit_code != getTestOpts().exit_code: if exit_code != opts.exit_code:
print 'Wrong exit code (expected', getTestOpts().exit_code, ', actual', exit_code, ')' print 'Wrong exit code (expected', opts.exit_code, ', actual', exit_code, ')'
dump_stdout(name) dump_stdout(name)
dump_stderr(name) dump_stderr(name)
return 'fail' return 'fail'
...@@ -805,7 +807,7 @@ def simple_run( name, way, prog, args ): ...@@ -805,7 +807,7 @@ def simple_run( name, way, prog, args ):
check_hp = my_rts_flags.find("-h") != -1 check_hp = my_rts_flags.find("-h") != -1
check_prof = my_rts_flags.find("-p") != -1 check_prof = my_rts_flags.find("-p") != -1
if getTestOpts().ignore_output or \ if opts.ignore_output or \
(check_stderr_ok(name) and (check_stderr_ok(name) and
check_stdout_ok(name) and check_stdout_ok(name) and
(not check_hp or (exit_code > 127 and exit_code != 251) or check_hp_ok(name)) and (not check_hp or (exit_code > 127 and exit_code != 251) or check_hp_ok(name)) and
......
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