Ejemplo n.º 1
0
def run_wasm_dis_tests():
    print('\n[ checking wasm-dis on provided binaries... ]\n')

    for t in shared.get_tests(shared.options.binaryen_test, ['.wasm']):
        print('..', os.path.basename(t))
        cmd = shared.WASM_DIS + [t]
        if os.path.isfile(t + '.map'):
            cmd += ['--source-map', t + '.map']

        actual = support.run_command(cmd)
        shared.fail_if_not_identical_to_file(actual, t + '.fromBinary')

        # also verify there are no validation errors
        def check():
            cmd = shared.WASM_OPT + [t, '-all']
            support.run_command(cmd)

        shared.with_pass_debug(check)

        shared.validate_binary(t)
Ejemplo n.º 2
0
def run_wasm_dis_tests():
    print('\n[ checking wasm-dis on provided binaries... ]\n')

    for t in tests:
        if t.endswith('.wasm') and not t.startswith('spec'):
            print('..', t)
            t = os.path.join(options.binaryen_test, t)
            cmd = WASM_DIS + [t]
            if os.path.isfile(t + '.map'):
                cmd += ['--source-map', t + '.map']

            actual = run_command(cmd)
            fail_if_not_identical_to_file(actual, t + '.fromBinary')

            # also verify there are no validation errors
            def check():
                cmd = WASM_OPT + [t, '-all']
                run_command(cmd)

            with_pass_debug(check)

            validate_binary(t)