summaryrefslogtreecommitdiff
path: root/check.py
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2019-08-21 08:54:57 -0700
committerGitHub <noreply@github.com>2019-08-21 08:54:57 -0700
commitc57f93c8919ab33574e5ce78f0044980ca33de76 (patch)
treed9a536f7e55b0f4018a257cb61e0e97a113abdac /check.py
parent2895ca0816507a9ca1ea19b5d990a1bb8299c9c4 (diff)
downloadbinaryen-c57f93c8919ab33574e5ce78f0044980ca33de76.tar.gz
binaryen-c57f93c8919ab33574e5ce78f0044980ca33de76.tar.bz2
binaryen-c57f93c8919ab33574e5ce78f0044980ca33de76.zip
Remove test output from source tree (#2114)
Diffstat (limited to 'check.py')
-rwxr-xr-xcheck.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/check.py b/check.py
index 3c9e5255a..6cdbb2a44 100755
--- a/check.py
+++ b/check.py
@@ -29,7 +29,7 @@ from scripts.test.shared import (
fail_if_not_identical, fail_if_not_contained, has_vanilla_emcc,
has_vanilla_llvm, minify_check, options, tests, requested, warnings,
has_shell_timeout, fail_if_not_identical_to_file, with_pass_debug,
- validate_binary
+ validate_binary, test_out
)
# For shared.num_failures. Cannot import directly because modifications made in
@@ -84,9 +84,10 @@ def run_wasm_opt_tests():
for extra_args in [[], ['--no-validation']]:
wast = os.path.join(options.binaryen_test, 'hello_world.wast')
delete_from_orbit('a.wast')
- cmd = WASM_OPT + [wast, '-o', 'a.wast', '-S'] + extra_args
+ out = os.path.join(test_out, 'a.wast')
+ cmd = WASM_OPT + [wast, '-o', out, '-S'] + extra_args
run_command(cmd)
- fail_if_not_identical_to_file(open('a.wast').read(), wast)
+ fail_if_not_identical_to_file(open(out).read(), wast)
print('\n[ checking wasm-opt binary reading/writing... ]\n')
@@ -174,10 +175,11 @@ def run_wasm_opt_tests():
print('\n[ checking wasm-opt debugInfo read-write... ]\n')
- for t in os.listdir('test'):
+ test_dir = os.path.join(options.binaryen_root, 'test')
+ for t in os.listdir(test_dir):
if t.endswith('.fromasm') and 'debugInfo' in t:
print('..', t)
- t = os.path.join('test', t)
+ t = os.path.join(test_dir, t)
f = t + '.read-written'
run_command(WASM_AS + [t, '--source-map=a.map', '-o', 'a.wasm', '-g'])
run_command(WASM_OPT + ['a.wasm', '--input-source-map=a.map', '-o', 'b.wasm', '--output-source-map=b.map', '-g'])
@@ -493,7 +495,7 @@ def run_gcc_tests():
cmd = ['-I' + os.path.join(options.binaryen_root, 'src'), '-g', '-pthread', '-o', output_file]
if t.endswith('.txt'):
# check if there is a trace in the file, if so, we should build it
- out = subprocess.Popen([os.path.join('scripts', 'clean_c_api_trace.py'), os.path.join(options.binaryen_test, 'example', t)], stdout=subprocess.PIPE).communicate()[0]
+ out = subprocess.check_output([os.path.join(options.binaryen_root, 'scripts', 'clean_c_api_trace.py'), os.path.join(options.binaryen_test, 'example', t)])
if len(out) == 0:
print(' (no trace in ', t, ')')
continue