GitLab will continue to be upgraded from 11.4.5-ce.0 on November 25th 2019 at 4.00pm (AEDT) to 5.00pm (AEDT) due to Critical Security Patch Availability. During the update, GitLab and Mattermost services will not be available.

Commit 59d0acdc authored by John Zhang's avatar John Zhang

added RPySOM interpreter test

parent da24a326
Pipeline #395 failed with stage
in 75 minutes and 3 seconds
......@@ -98,12 +98,13 @@ testjit:otherops:
testjit:rpython:
stage: test
script:
- git clone https://github.com/microvm/RPySOM.git tests/test_jit/RPySOM
- git clone https://gitlab.anu.edu.au/mu/mu-client-pypy.git tests/test_jit/mu-client-pypy
- cd tests/test_jit/mu-client-pypy
- git checkout mu-rewrite
- git apply pypy.patch
- cd $CI_PROJECT_DIR/tests/test_jit
- LD_LIBRARY_PATH=. RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy MU_ZEBU=$CI_PROJECT_DIR pytest test_rpython*.py -v
- LD_LIBRARY_PATH=. RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy:RPySOM RPYSOM=RPySOM MU_ZEBU=$CI_PROJECT_DIR pytest test_rpython*.py -v
cache:
key: "$CI_BUILD_STAGE/$CI_BUILD_REF_NAME"
paths:
......
......@@ -988,12 +988,12 @@ def test_exception_stack_unwind():
def run_boot_image(entry, output, has_c_main_sig = False, args = [], impl=os.getenv('MU_IMPL', 'zebu'), vmargs = ""):
from rpython.translator.interactive import Translation
from rpython.translator.platform import log as log_platform
if has_c_main_sig:
t = Translation(entry, [rffi.INT, rffi.CCHARPP], backend='mu', impl=impl, codegen='api', vmargs=vmargs)
t.driver.disable(['entrypoint_mu'])
else:
t = Translation(entry, None, backend='mu', impl=impl, codegen='api', vmargs=vmargs)
t = Translation(entry, None, backend='mu', impl=impl, codegen='c', vmargs=vmargs)
t.driver.standalone = True # force standalone
t.driver.exe_name = output
......@@ -1014,8 +1014,8 @@ def run_boot_image(entry, output, has_c_main_sig = False, args = [], impl=os.get
else:
from rpython.rlib.rmu import holstein
runmu = py.path.local(holstein.mu_dir).join('..', 'tools', 'runmu.sh')
flags = ['--vmLog=ERROR']
# log_platform.execute(' '.join([str(runmu)] + flags + [str(exe)] + cmdargs))
flags = ['--vmLog=ERROR', '--losSize=780M', '--sosSize=780M']
log_platform.execute(' '.join([str(runmu)] + flags + [str(exe)] + args))
res = platform.execute(runmu, flags + [str(exe)] + args)
return res
......@@ -1406,6 +1406,63 @@ def test_float():
assert res.out == '(0.893876, 1.000000, 0.447179)\n'
@may_spawn_proc
def test_RPySOM():
from som.vm.universe import main, Exit
def entry_point(argv):
try:
main(argv)
except Exit, e:
return e.code
except Exception, e:
os.write(2, "ERROR: %s thrown during execution.\n" % e)
return 1
return 1
RPYSOM = os.environ.get('RPYSOM', str(py.path.local(__file__).join('..', 'RPySOM')))
res = run_boot_image(entry_point, '/tmp/RPySOM-no-jit-mu',
args=['-cp', '%(RPYSOM)s/Smalltalk' % locals(),
'%(RPYSOM)s/TestSuite/TestHarness.som' % locals()])
assert res.returncode == 0, res.err
expected_out = \
"""\
Testing...
Running test EmptyTest
Running test SystemTest
Running test ArrayTest
Running test ClassLoadingTest
Running test ClosureTest
Running test CoercionTest
Running test CompilerReturnTest
Running test DoubleTest
Running test HashTest
Running test IntegerTest
Warning: Test instance of IntegerTest failed: Identity failed. Expected: true, but Actual: false
Warning: Test instance of IntegerTest failed: Identity failed. Expected: true, but Actual: false
Running test ObjectSizeTest
Warning: Test instance of ObjectSizeTest failed: Plain object does not have size 1.
Warning: Test instance of ObjectSizeTest failed: Integer object does not have size 1.
Warning: Test instance of ObjectSizeTest failed: hello String object does not have size 1.
Warning: Test instance of ObjectSizeTest failed: Empty array object does not have size 1.
Warning: Test instance of ObjectSizeTest failed: Array object (length 4) does not have size 5.
Running test PreliminaryTest
Running test ReflectionTest
Running test SelfBlockTest
Running test SuperTest
Running test SymbolTest
Running test VectorTest
Running test BlockTest
Running test StringTest
Running test ClassStructureTest
Definition of Class changed. Testcase needs to be updated.
Running test DoesNotUnderstandTest
...done
"""
assert res.out == expected_out
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
......
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