Example #1
0
def run_torture_tests():
    print '\n[ checking torture testcases... ]\n'

    unexpected_result_count = 0

    import test.waterfall.src.link_assembly_files as link_assembly_files
    s2wasm_torture_out = os.path.abspath(
        os.path.join(options.binaryen_test, 's2wasm-torture-out'))
    if os.path.isdir(s2wasm_torture_out):
        shutil.rmtree(s2wasm_torture_out)
    os.mkdir(s2wasm_torture_out)
    unexpected_result_count += link_assembly_files.run(
        linker=os.path.abspath(S2WASM_EXE),
        files=os.path.abspath(
            os.path.join(options.binaryen_test, 'torture-s', '*.s')),
        fails=os.path.abspath(
            os.path.join(options.binaryen_test,
                         's2wasm_known_gcc_test_failures.txt')),
        out=s2wasm_torture_out)
    assert os.path.isdir(s2wasm_torture_out
                         ), 'Expected output directory %s' % s2wasm_torture_out

    import test.waterfall.src.execute_files as execute_files
    unexpected_result_count += execute_files.run(
        runner=os.path.abspath(WASM_SHELL_EXE),
        files=os.path.abspath(os.path.join(s2wasm_torture_out, '*.wast')),
        fails=os.path.abspath(
            os.path.join(options.binaryen_test,
                         's2wasm_known_binaryen_shell_test_failures.txt')),
        out='',
        wasmjs='')

    shutil.rmtree(s2wasm_torture_out)
    if unexpected_result_count:
        fail('%s failures' % unexpected_result_count, '0 failures')
Example #2
0
def run_torture_tests():
    print '\n[ checking torture testcases... ]\n'

    # torture tests are parallel anyhow, don't create multiple threads in each child
    old_cores = os.environ.get('BINARYEN_CORES')
    try:
        os.environ['BINARYEN_CORES'] = '1'

        unexpected_result_count = 0

        import test.waterfall.src.link_assembly_files as link_assembly_files
        s2wasm_torture_out = os.path.abspath(
            os.path.join(options.binaryen_test, 's2wasm-torture-out'))
        if os.path.isdir(s2wasm_torture_out):
            shutil.rmtree(s2wasm_torture_out)
        os.mkdir(s2wasm_torture_out)
        unexpected_result_count += link_assembly_files.run(
            linker=os.path.abspath(S2WASM_EXE),
            files=os.path.abspath(
                os.path.join(options.binaryen_test, 'torture-s', '*.s')),
            fails=[
                os.path.abspath(
                    os.path.join(options.binaryen_test,
                                 's2wasm_known_gcc_test_failures.txt'))
            ],
            attributes=['O2'],
            out=s2wasm_torture_out,
            args=None)
        assert os.path.isdir(
            s2wasm_torture_out
        ), 'Expected output directory %s' % s2wasm_torture_out

        import test.waterfall.src.execute_files as execute_files
        unexpected_result_count += execute_files.run(
            runner=os.path.abspath(WASM_SHELL_EXE),
            files=os.path.abspath(os.path.join(s2wasm_torture_out, '*.wast')),
            fails=[
                os.path.abspath(
                    os.path.join(
                        options.binaryen_test,
                        's2wasm_known_binaryen_shell_test_failures.txt'))
            ],
            attributes=['O2'],
            out='',
            wasmjs='')

        shutil.rmtree(s2wasm_torture_out)
        if unexpected_result_count:
            fail('%s failures' % unexpected_result_count, '0 failures')

    finally:
        if old_cores:
            os.environ['BINARYEN_CORES'] = old_cores
        else:
            del os.environ['BINARYEN_CORES']
Example #3
0
  import test.waterfall.src.link_assembly_files as link_assembly_files
  s2wasm_torture_out = os.path.abspath(os.path.join('test', 's2wasm-torture-out'))
  if os.path.isdir(s2wasm_torture_out):
    shutil.rmtree(s2wasm_torture_out)
  os.mkdir(s2wasm_torture_out)
  unexpected_result_count += link_assembly_files.run(
      linker=os.path.abspath(os.path.join('bin', 's2wasm')),
      files=os.path.abspath(os.path.join('test', 'torture-s', '*.s')),
      fails=os.path.abspath(os.path.join('test', 's2wasm_known_gcc_test_failures.txt')),
      out=s2wasm_torture_out)
  assert os.path.isdir(s2wasm_torture_out), 'Expected output directory %s' % s2wasm_torture_out

  import test.waterfall.src.execute_files as execute_files
  unexpected_result_count += execute_files.run(
      runner=os.path.abspath(os.path.join('bin', 'binaryen-shell')),
      files=os.path.abspath(os.path.join(s2wasm_torture_out, '*.wast')),
      fails=os.path.abspath(os.path.join('test', 's2wasm_known_binaryen_shell_test_failures.txt')),
      out='',
      wasmjs='')

  shutil.rmtree(s2wasm_torture_out)
  if unexpected_result_count:
    fail('%s failures' % unexpected_result_count, '0 failures')

if has_vanilla_emcc:

  print '\n[ checking emcc WASM_BACKEND testcases...]\n'

  try:
    if has_vanilla_llvm:
      os.environ['LLVM'] = BIN_DIR # use the vanilla LLVM
    else:
Example #4
0
    unexpected_result_count += link_assembly_files.run(
        linker=os.path.abspath(S2WASM_EXE),
        files=os.path.abspath(
            os.path.join(options.binaryen_test, 'torture-s', '*.s')),
        fails=os.path.abspath(
            os.path.join(options.binaryen_test,
                         's2wasm_known_gcc_test_failures.txt')),
        out=s2wasm_torture_out)
    assert os.path.isdir(s2wasm_torture_out
                         ), 'Expected output directory %s' % s2wasm_torture_out

    import test.waterfall.src.execute_files as execute_files
    unexpected_result_count += execute_files.run(
        runner=os.path.abspath(WASM_SHELL_EXE),
        files=os.path.abspath(os.path.join(s2wasm_torture_out, '*.wast')),
        fails=os.path.abspath(
            os.path.join(options.binaryen_test,
                         's2wasm_known_binaryen_shell_test_failures.txt')),
        out='',
        wasmjs='')

    shutil.rmtree(s2wasm_torture_out)
    if unexpected_result_count:
        fail('%s failures' % unexpected_result_count, '0 failures')

if has_vanilla_emcc and has_vanilla_llvm and 0:

    print '\n[ checking emcc WASM_BACKEND testcases...]\n'

    try:
        if has_vanilla_llvm:
            os.environ['LLVM'] = BIN_DIR  # use the vanilla LLVM
Example #5
0
        shutil.rmtree(s2wasm_torture_out)
    os.mkdir(s2wasm_torture_out)
    unexpected_result_count += link_assembly_files.run(
        linker=os.path.abspath(os.path.join('bin', 's2wasm')),
        files=os.path.abspath(os.path.join('test', 'torture-s', '*.s')),
        fails=os.path.abspath(
            os.path.join('test', 's2wasm_known_gcc_test_failures.txt')),
        out=s2wasm_torture_out)
    assert os.path.isdir(s2wasm_torture_out
                         ), 'Expected output directory %s' % s2wasm_torture_out

    import test.waterfall.src.execute_files as execute_files
    unexpected_result_count += execute_files.run(
        runner=os.path.abspath(os.path.join('bin', 'wasm-shell')),
        files=os.path.abspath(os.path.join(s2wasm_torture_out, '*.wast')),
        fails=os.path.abspath(
            os.path.join('test',
                         's2wasm_known_binaryen_shell_test_failures.txt')),
        out='',
        wasmjs='')

    shutil.rmtree(s2wasm_torture_out)
    if unexpected_result_count:
        fail('%s failures' % unexpected_result_count, '0 failures')

if has_vanilla_emcc and has_vanilla_llvm and 0:

    print '\n[ checking emcc WASM_BACKEND testcases...]\n'

    try:
        if has_vanilla_llvm:
            os.environ['LLVM'] = BIN_DIR  # use the vanilla LLVM
Example #6
0
        shutil.rmtree(s2wasm_torture_out)
    os.mkdir(s2wasm_torture_out)
    unexpected_result_count += link_assembly_files.run(
        linker=os.path.abspath(os.path.join("bin", "s2wasm")),
        files=os.path.abspath(os.path.join("test", "torture-s", "*.s")),
        fails=os.path.abspath(os.path.join("test", "s2wasm_known_gcc_test_failures.txt")),
        out=s2wasm_torture_out,
    )
    assert os.path.isdir(s2wasm_torture_out), "Expected output directory %s" % s2wasm_torture_out

    import test.waterfall.src.execute_files as execute_files

    unexpected_result_count += execute_files.run(
        runner=os.path.abspath(os.path.join("bin", "binaryen-shell")),
        files=os.path.abspath(os.path.join(s2wasm_torture_out, "*.wast")),
        fails=os.path.abspath(os.path.join("test", "s2wasm_known_binaryen_shell_test_failures.txt")),
        out="",
        wasmjs="",
    )

    shutil.rmtree(s2wasm_torture_out)
    if unexpected_result_count:
        fail("%s failures" % unexpected_result_count, "0 failures")

if has_vanilla_emcc and has_vanilla_llvm:

    print "\n[ checking emcc WASM_BACKEND testcases...]\n"

    try:
        if has_vanilla_llvm:
            os.environ["LLVM"] = BIN_DIR  # use the vanilla LLVM
Example #7
0
  import test.waterfall.src.link_assembly_files as link_assembly_files
  s2wasm_torture_out = os.path.abspath(os.path.join(options.binaryen_test, 's2wasm-torture-out'))
  if os.path.isdir(s2wasm_torture_out):
    shutil.rmtree(s2wasm_torture_out)
  os.mkdir(s2wasm_torture_out)
  unexpected_result_count += link_assembly_files.run(
      linker=os.path.abspath(S2WASM_EXE),
      files=os.path.abspath(os.path.join(options.binaryen_test, 'torture-s', '*.s')),
      fails=os.path.abspath(os.path.join(options.binaryen_test, 's2wasm_known_gcc_test_failures.txt')),
      out=s2wasm_torture_out)
  assert os.path.isdir(s2wasm_torture_out), 'Expected output directory %s' % s2wasm_torture_out

  import test.waterfall.src.execute_files as execute_files
  unexpected_result_count += execute_files.run(
      runner=os.path.abspath(WASM_SHELL_EXE),
      files=os.path.abspath(os.path.join(s2wasm_torture_out, '*.wast')),
      fails=os.path.abspath(os.path.join(options.binaryen_test, 's2wasm_known_binaryen_shell_test_failures.txt')),
      out='',
      wasmjs='')

  shutil.rmtree(s2wasm_torture_out)
  if unexpected_result_count:
    fail('%s failures' % unexpected_result_count, '0 failures')

if has_vanilla_emcc and has_vanilla_llvm and 0:

  print '\n[ checking emcc WASM_BACKEND testcases...]\n'

  try:
    if has_vanilla_llvm:
      os.environ['LLVM'] = BIN_DIR # use the vanilla LLVM
    else: