som_test.py 1.12 KB
Newer Older
1 2
import unittest
from parameterized import parameterized
3
from som.vm.universe import Universe
4

5

6 7
class SomTest(unittest.TestCase):
    @parameterized.expand([
8
        ("ClassStructure",),
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
        ("Array"         ,),
        ("BigInteger"    ,),
        ("Block"         ,),
        ("ClassLoading"  ,),

        ("Closure"       ,),
        ("Coercion"      ,),
        ("CompilerReturn",),
        ("Double"        ,),

        ("Empty"         ,),
        ("Hash"          ,),
        ("Integer"       ,),
        ("ObjectSize"    ,),

        ("Preliminary"   ,),
        ("Reflection"    ,),
        ("SelfBlock"     ,),
        ("Super"         ,),

29
        ("String"        ,),
30
        ("Symbol"        ,),
31
        ("System"        ,),
32 33 34
        ("Vector"        ,)])
    def test_som_test(self, test_name):
        args = ["-cp", "Smalltalk", "TestSuite/TestHarness.som", test_name]
35
        u = Universe(True)
36 37
        u.interpret(args)
        
38
        self.assertEquals(0, u.last_exit_code())
39 40 41 42 43

import sys
if sys.modules.has_key('pytest'):
    # hack to make pytest not to collect the unexpanded test method
    delattr(SomTest, "test_som_test")