Commit 73d50b59 authored by qinsoon's avatar qinsoon

separate SOM test in CI script

parent ee2f2993
Pipeline #515 failed with stages
in 57 minutes and 59 seconds
......@@ -120,6 +120,17 @@ testjit:otherops:
- RUST_BACKTRACE=1 pytest tests/test_jit/test_otherops.py -v
testjit:rpython:
stage: test
script:
- if [ -d "tests/test_jit/mu-client-pypy" ]; then rm -Rf tests/test_jit/mu-client-pypy; fi
- 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
- MU_LOG_LEVEL=info LD_LIBRARY_PATH=. RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy pytest test_rpython*.py -v
testjit:som:
stage: test
script:
- if [ -d "tests/test_jit/RPySOM" ]; then rm -Rf tests/test_jit/RPySOM; fi
......@@ -131,13 +142,4 @@ testjit:rpython:
- git checkout mu-rewrite
- git apply pypy.patch
- cd $CI_PROJECT_DIR/tests/test_jit
- MU_LOG_LEVEL=info LD_LIBRARY_PATH=. RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy:RPySOM/src RPYSOM=RPySOM pytest test_rpython*.py -v
# cache:
# key: "$CI_BUILD_STAGE/$CI_BUILD_REF_NAME"
# paths:
# - .cargo/registry/cache
# - .cargo/registry/index
# - target
# - Cargo.lock
# - tests/test_jit/mu-client-pypy
- MU_LOG_LEVEL=info LD_LIBRARY_PATH=. RUST_BACKTRACE=1 PYTHONPATH=mu-client-pypy:RPySOM/src RPYSOM=RPySOM pytest test_som.py -v
\ No newline at end of file
......@@ -1405,63 +1405,6 @@ def test_float():
assert res.returncode == 0, res.err
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
@may_spawn_proc
def test_open_file_as_stream():
from rpython.rlib.streamio import open_file_as_stream
......
from rpython.rtyper.lltypesystem import rffi, lltype
from rpython.rlib.rmu import zebu as rmu
from rpython.translator.platform import platform
from util import fncptr_from_rpy_func, fncptr_from_py_script, may_spawn_proc
import ctypes, py, stat, os
import pytest
from test_rpython import run_boot_image
@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
\ No newline at end of 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