예제 #1
0
def main():
    testcases = [
        (test_print, "test_print"),
        (test_output, "test_output"),
        (test_bad_arguments, "test_bad_arguments")
    ]
    harness.run(testcases)
예제 #2
0
파일: main.py 프로젝트: eerimoq/pumbaa
def main():
    testcases = [
        (test_help, "test_help"),
        (test_read_write, "test_read_write"),
        (test_bad_arguments, "test_bad_arguments")
    ]
    harness.run(testcases)
예제 #3
0
def main():
    testcases = [(test_print, "test_print"),
                 (test_tcp_client, "test_tcp_client"),
                 (test_tcp_server, "test_tcp_server"), (test_udp, "test_udp"),
                 (test_select, "test_select"),
                 (test_bad_arguments, "test_bad_arguments")]
    harness.run(testcases)
예제 #4
0
파일: main.py 프로젝트: southwolf/pumbaa
def main():
    testcases = [(test_print, "test_print"), (test_reset, "test_reset"),
                 (test_search, "test_search"),
                 (test_get_devices, "test_get_devices"),
                 (test_read, "test_read"), (test_write, "test_write"),
                 (test_bad_arguments, "test_bad_arguments")]
    harness.run(testcases)
예제 #5
0
def main():
    testcases = [
        (test_help, "test_help"),
        (test_read_write, "test_read_write"),
        (test_bad_arguments, "test_bad_arguments")
    ]
    harness.run(testcases)
예제 #6
0
파일: main.py 프로젝트: eerimoq/pumbaa
def main():
    testcases = [
        (test_print, "test_print"),
        (test_data_transfer, "test_data_transfer"),
        (test_bad_arguments, "test_bad_arguments")
    ]
    harness.run(testcases)
예제 #7
0
파일: main.py 프로젝트: eerimoq/pumbaa
def main():
    testcases = [
        (test_print, "test_print"),
        (test_falling_edge, "test_falling_edge"),
        (test_bad_arguments, "test_bad_arguments")
    ]
    harness.run(testcases)
예제 #8
0
파일: main.py 프로젝트: eerimoq/pumbaa
def main():
    testcases = [
        (test_print, "test_print"),
        (test_output, "test_output"),
        (test_bad_arguments, "test_bad_arguments")
    ]
    harness.run(testcases)
예제 #9
0
파일: main.py 프로젝트: southwolf/pumbaa
def main():
    testcases = [
        (test_output, "test_output"),
        (test_input, "test_input"),
        (test_set_mode, "test_set_mode"),
        (test_bad_arguments, "test_bad_arguments")
    ]
    harness.run(testcases)
예제 #10
0
파일: main.py 프로젝트: eerimoq/pumbaa
def main():
    testcases = [
        (test_help, "test_help"),
        (test_register_unregister, "test_register_unregister"),
        (test_poll, "test_poll"),
        (test_bad_arguments, "test_bad_arguments"),
    ]
    harness.run(testcases)
예제 #11
0
def main():
    testcases = [
        (test_help, "test_help"),
        (test_single_shot_timer, "test_single_shot_timer"),
        (test_periodic_timer, "test_periodic_timer"),
        (test_empty, "test_empty"),
        (test_bad_arguments, "test_bad_arguments")
    ]
    harness.run(testcases)
예제 #12
0
파일: main.py 프로젝트: eerimoq/pumbaa
def main():
    testcases = [
        (test_print, "test_print"),
        (test_tcp_client, "test_tcp_client"),
        (test_tcp_server, "test_tcp_server"),
        (test_udp, "test_udp"),
        (test_select, "test_select"),
        (test_bad_arguments, "test_bad_arguments")
    ]
    harness.run(testcases)
예제 #13
0
파일: main.py 프로젝트: eerimoq/pumbaa
def main():
    testcases = [
        (test_start, "test_start"),
        (test_print, "test_print"),
        (test_read_cid, "test_read_cid"),
        (test_read_csd, "test_read_csd"),
        (test_read_write, "test_read_write"),
        (test_read_write_fail, "test_read_write_fail"),
        (test_bad_arguments, "test_bad_arguments"),
        (test_stop, "test_stop")
    ]
    harness.run(testcases)
예제 #14
0
파일: main.py 프로젝트: southwolf/pumbaa
def main():
    testcases = [
        (test_assert_raises, "test_assert_raises"),
        (test_passed, "test_passed"),
        (test_skipped, "test_skipped"),
        (test_failed, "test_failed")
    ]

    try:
        harness.run(testcases)
        raise RuntimeError()
    except harness.SuiteError as e:
        if e.failed != 1 or e.skipped != 1:
            raise RuntimeError()
예제 #15
0
파일: test_compare.py 프로젝트: jhgg/hyrule
def test_cmp():
    data = harness.run('''
        A = 1
        B = 2

        TA = A < B
        TB = A <= A
        TC = B > A
        TD = B >= A

        FA = B < A
        FB = B <= A
        FC = A > B
        FD = A >= B
    ''')

    assert data == {
        'A': 1,
        'B': 2,

        'TA': True,
        'TB': True,
        'TC': True,
        'TD': True,

        'FA': False,
        'FB': False,
        'FC': False,
        'FD': False,
    }
예제 #16
0
def test_list_literal():
    data = harness.run('''
        List = [1, 2.5, "hello", [3, 4], True, False, None]
    ''')

    assert data == {
        'List': [1, 2.5, "hello", [3, 4], True, False, None]
    }
예제 #17
0
def test_json_data_extraction():
    data = harness.run('''
        Foo = JsonData('$.foo')
    ''', {'foo': 'bar'})

    assert data == {
        'Foo': 'bar'
    }
예제 #18
0
def test_string_literal():
    data = harness.run('''
        Str = "hello world"
    ''')

    assert data == {
        'Str': 'hello world'
    }
예제 #19
0
def test_num_literal():
    data = harness.run('''
        One = 1
    ''')

    assert data == {
        'One': 1
    }
예제 #20
0
파일: main.py 프로젝트: southwolf/pumbaa
def main():
    testcases = [
        (test_format, "test_format"),
        (test_directory, "test_directory"),
        (test_missing_file, "test_missing_file"),
        (test_create, "test_create"),
        (test_append, "test_append"),
        (test_read_write, "test_read_write"),
        (test_seek_tell, "test_seek_tell"),
        (test_stat, "test_stat"),
        (test_remove, "test_remove"),
        (test_listdir, "test_listdir"),
        (test_flush, "test_flush"),
        (test_print, "test_print"),
        (test_system, "test_system")
    ]
    harness.run(testcases)
예제 #21
0
def test_none_literal():
    data = harness.run('''
        N = None
    ''')

    assert data == {
        'N': None
    }
예제 #22
0
def test_bool_literal():
    data = harness.run('''
        T = True
        F = False
    ''')

    assert data == {
        'T': True,
        'F': False
    }
예제 #23
0
파일: test_compare.py 프로젝트: jhgg/hyrule
def test_inv():
    data = harness.run('''
        F = ~True
        T = ~False
        # None negated is still None.
        N = ~None
    ''')

    assert data == {
        'F': False,
        'T': True,
        'N': None,
    }
예제 #24
0
파일: test_compare.py 프로젝트: jhgg/hyrule
def test_in():
    data = harness.run('''
        A = [1, 2, 3]

        T = (2).in_(A)
        F = (4).in_(A)
    ''')

    assert data == {
        'A': [1, 2, 3],
        'T': True,
        'F': False,
    }
예제 #25
0
파일: test_compare.py 프로젝트: jhgg/hyrule
def test_list_lit_contains():
    data = harness.run('''
        A = [1, 2, 3]

        T = A.contains(2)
        F = A.contains(4)
    ''')

    assert data == {
        'A': [1, 2, 3],
        'T': True,
        'F': False,
    }
예제 #26
0
파일: test_compare.py 프로젝트: jhgg/hyrule
def test_and():
    data = harness.run('''
        T1 = True & True
        T2 = True & ~False
        T3 = ~False & ~False
        T4 = ~False & True
        T5 = True & True & True

        F1 = False & False
        F2 = False & False & False
    ''')

    assert data == {
        'T1': True,
        'T2': True,
        'T3': True,
        'T4': True,
        'T5': True,
        'F1': False,
        'F2': False,
    }
예제 #27
0
파일: test_compare.py 프로젝트: jhgg/hyrule
def test_or():
    data = harness.run('''
        T1 = True | False
        T2 = True | True
        T3 = False | True
        T4 = False | False | True
        T5 = True | False | False
        T6 = False | True | False

        F = False | False
    ''')

    assert data == {
        'T1': True,
        'T2': True,
        'T3': True,
        'T4': True,
        'T5': True,
        'T6': True,
        'F': False,
    }
예제 #28
0
def main():
    passed = 0
    skipped = 0
    failed = 0
    total = 0

    print()
    print(
        "================================== ALL BEGIN ==================================\n"
    )

    for suite in SUITES:
        print(suite + ":")
        module = __import__(suite, None, None)
        try:
            result = harness.run(module.TESTCASES)
            total += result[0]
            passed += result[1]
            skipped += result[2]
            failed += result[3]
        except harness.SuiteError as e:
            total += e.total
            passed += e.passed
            skipped += e.skipped
            failed += e.failed
        del module

    ok = passed + skipped == total

    print("report: total({}), passed({}), failed({}), skipped({})\n".format(
        total, passed, failed, skipped))

    print(
        "=============================== ALL END ({}) ==============================\n"
        .format("PASSED" if ok else "FAILED"))

    if not ok:
        raise Exception()
예제 #29
0
파일: test_compare.py 프로젝트: jhgg/hyrule
def test_combined():
    data = harness.run('''
        T1 = True & True
        T2 = T1 & True
        T3 = T2 & True
        T4 = T1 & T2 & T3

        F1 = ~T1
        F2 = ~T2
        F3 = ~T3
        F4 = ~T4
    ''')

    assert data == {
        'T1': True,
        'T2': True,
        'T3': True,
        'T4': True,
        'F1': False,
        'F2': False,
        'F3': False,
        'F4': False,
    }
예제 #30
0
파일: test_compare.py 프로젝트: jhgg/hyrule
def test_entity_equality():
    data = harness.run('''
        A = Entity('User', '1234')
        B = Entity('User', '1234')
        C = Entity('User', '4567')

        EqA = A == B
        EqB = B == A
        EqC = A == '1234'
        EqD = '1234' == A
        EqE = A == C
        EqF = C == A

        NeA = A != B
        NeB = A != '1234'
        NeC = A != '4567'
        NeD = A != C
    ''')

    assert data == {
        'A': EntityRef('User', '1234'),
        'B': EntityRef('User', '1234'),
        'C': EntityRef('User', '4567'),

        'EqA': True,
        'EqB': True,
        'EqC': True,
        'EqD': True,
        'EqE': False,
        'EqF': False,

        'NeA': False,
        'NeB': False,
        'NeC': True,
        'NeD': True,
    }
예제 #31
0
파일: test_compare.py 프로젝트: jhgg/hyrule
def test_equality():
    data = harness.run('''
        Foo = "hello"
        Bar = "world"
        FooEqA = Foo == "hello"
        FooEqB = "hello" == Foo
        FooEqC = "world" == Foo
        FooEqD = Foo == "world"
        FooEqBar = Foo == Bar
        BarEqFoo = Bar == Foo
        FooEqFoo = Foo == Foo
    ''')

    assert data == {
        'Foo': 'hello',
        'Bar': 'world',
        'FooEqA': True,
        'FooEqB': True,
        'FooEqC': False,
        'FooEqD': False,
        'FooEqBar': False,
        'BarEqFoo': False,
        'FooEqFoo': True
    }
예제 #32
0
파일: buildkite.py 프로젝트: xyuan/plaidml
def cmd_test(args, remainder):
    import harness
    harness.run(args, remainder)
예제 #33
0
def main():
    testcases = [(test_print, "test_print"),
                 (test_data_transfer, "test_data_transfer"),
                 (test_bad_arguments, "test_bad_arguments")]
    harness.run(testcases)
예제 #34
0
def main():
    testcases = [(test_station, "test_station"),
                 (test_bad_arguments, "test_bad_arguments")]
    harness.run(testcases)
예제 #35
0
파일: main.py 프로젝트: eerimoq/pumbaa
def main():
    testcases = [
        (test_print, "test_print"),
        (test_start, "test_start")
    ]
    harness.run(testcases)
예제 #36
0
파일: runme.py 프로젝트: ChunHungLiu/swig
import sys
sys.path.append('..')
import harness


def proc(mod):
    x = mod.MyClass()
    for i in range(10000000):
        x.func()

harness.run(proc)
예제 #37
0
파일: main.py 프로젝트: eerimoq/pumbaa
def main():
    testcases = [
        (test_station, "test_station"),
        (test_bad_arguments, "test_bad_arguments")
    ]
    harness.run(testcases)
예제 #38
0
import sys
sys.path.append('..')
import harness


def proc(mod):
    x = mod.H()
    for i in range(10000000):
        x.func()


harness.run(proc)
예제 #39
0
파일: main.py 프로젝트: southwolf/pumbaa
def main():
    testcases = [(test_print, "test_print"), (test_convert, "test_convert"),
                 (test_async_convert, "test_async_convert"),
                 (test_bad_arguments, "test_bad_arguments")]
    harness.run(testcases)
예제 #40
0
def cmd_test(args, remainder):
    harness.run(args, remainder)
예제 #41
0
파일: main.py 프로젝트: eerimoq/pumbaa
def main():
    testcases = [
        (test_smoke, "test_smoke")
    ]
    harness.run(testcases)