Commit 74285055 authored by John Zhang's avatar John Zhang

fix: mistake in passing argument; add new test print argv in high level rpython code

parent f5b1e9d9
......@@ -1009,7 +1009,7 @@ def test_make_boot_image_simple():
exe = py.path.local('/tmp/test_make_boot_image_mu.mu')
# zebu
exe.chmod(stat.S_IRWXU)
res = platform.execute(str(exe), 'abc', '123')
res = platform.execute(str(exe), ['abc', '123'])
# holstein
# res = platform.execute('/Users/johnz/Documents/Work/mu-impl-ref2/tools/runmu.sh',
# ['--vmLog=ERROR', str(exe), 'abc', '123'])
......@@ -1017,6 +1017,29 @@ def test_make_boot_image_simple():
assert res.out == '%s\nabc\n123\n' % exe
@may_spawn_proc
def test_rpytarget_print_argv():
from rpython.translator.interactive import Translation
def main(argv):
print argv
return 0
t = Translation(main, None, backend='mu', muimpl='ref', mucodegen='api')
t.driver.exe_name = '/tmp/test_printargv_%(backend)s'
t.compile_mu()
exe = py.path.local('/tmp/test_printargv_mu.mu')
# zebu
exe.chmod(stat.S_IRWXU)
res = platform.execute(str(exe), ['abc', '123'])
# holstein
# res = platform.execute('/Users/johnz/Documents/Work/mu-impl-ref2/tools/runmu.sh',
# ['--vmLog=ERROR', str(exe), 'abc', '123'])
assert res.returncode == 0, res.err
assert res.out == '[%s, abc, 123]\n' % exe
@pytest.mark.xfail(reason='not implemented yet')
@may_spawn_proc
def test_rpytarget_sha1sum():
......@@ -1041,7 +1064,7 @@ The light shines in the darkness, and the darkness has not overcome it.
fp.write(john1)
# zebu
exe.chmod(stat.S_IRWXU)
res = platform.execute(str(exe), 'abc', '123')
res = platform.execute(str(exe), [str(test_file)])
# holstein
# res = platform.execute('/Users/johnz/Documents/Work/mu-impl-ref2/tools/runmu.sh',
# ['--vmLog=ERROR', str(exe), str(test_file)])
......
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