diff options
author | Dan Gohman <sunfish@mozilla.com> | 2016-01-06 12:52:09 -0800 |
---|---|---|
committer | Dan Gohman <sunfish@mozilla.com> | 2016-01-06 16:15:25 -0800 |
commit | bde95949f89e8f288ed0a9a8356460f9e3bbbbbf (patch) | |
tree | 11889e6989ddd78ba23b0d4781c2ffe6229c6ff2 /check.py | |
parent | 176a955c63f7891f00c1f29e33079dc3d77539da (diff) | |
download | binaryen-bde95949f89e8f288ed0a9a8356460f9e3bbbbbf.tar.gz binaryen-bde95949f89e8f288ed0a9a8356460f9e3bbbbbf.tar.bz2 binaryen-bde95949f89e8f288ed0a9a8356460f9e3bbbbbf.zip |
Replace the experimental/prototype-wasmate/test tests.
Use the llvm_autogenerated tests instead.
Diffstat (limited to 'check.py')
-rwxr-xr-x | check.py | 66 |
1 files changed, 21 insertions, 45 deletions
@@ -191,26 +191,6 @@ for t in spec_tests: if actual != expected: fail(actual, expected) -print '\n[ checking binaryen-shell experimental testcases... ]\n' - -if len(requested) == 0: - BLACKLIST = ['call.wast', # bad indirect_call, no type - 'cfg-stackify.wast', # call an import $ which no return value, but in a context with a return value - 'inline-asm.wast', # there is a (foo ..) s-expression block, perhaps inline asm? not a valid s-expression - 'switch.wast', # bad tableswitch, no (table ..) inside it - ] - experimental_tests = [os.path.join('experimental', 'prototype-wasmate', 'test', 'expected-output', t) for t in sorted(os.listdir(os.path.join('test', 'experimental', 'prototype-wasmate', 'test', 'expected-output'))) if t not in BLACKLIST] -else: - experimental_tests = requested[:] - -for t in experimental_tests: - if t.startswith('experimental') and t.endswith('.wast'): - print '..', t - wast = os.path.join('test', t) - proc = subprocess.Popen([os.path.join('bin', 'binaryen-shell'), wast], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - actual, err = proc.communicate() - assert proc.returncode == 0, err - print '\n[ checking wasm2asm testcases... ]\n' for wasm in tests + [os.path.join('spec', name) for name in ['address.wast']]:#spec_tests: @@ -248,32 +228,28 @@ for wasm in tests + [os.path.join('spec', name) for name in ['address.wast']]:#s print '\n[ checking .s testcases... ]\n' -for s in sorted(os.listdir(os.path.join('test', 'dot_s'))) + sorted(os.listdir(os.path.join('test', 'experimental', 'prototype-wasmate', 'test'))): - if not s.endswith('.s'): continue - if s in ['inline-asm.s', # what is this? - 'offset-folding.s' # unresolved symbol x - ]: continue - print '..', s - wasm = s.replace('.s', '.wast') - full = os.path.join('test', 'dot_s', s) - if not os.path.exists(full): - full = os.path.join('test', 'experimental', 'prototype-wasmate', 'test', s) - actual, err = subprocess.Popen([os.path.join('bin', 's2wasm'), full], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() - assert err == '', 'bad err:' + err - - # verify output - expected_file = os.path.join('test', 'dot_s', wasm) - if not os.path.exists(expected_file): - print actual - raise Exception('output ' + expected_file + ' does not exist') - expected = open(expected_file).read() - if actual != expected: - fail(actual, expected) +for dot_s_dir in ['dot_s', 'llvm_autogenerated']: + for s in sorted(os.listdir(os.path.join('test', dot_s_dir))): + if not s.endswith('.s'): continue + print '..', s + wasm = s.replace('.s', '.wast') + full = os.path.join('test', dot_s_dir, s) + actual, err = subprocess.Popen([os.path.join('bin', 's2wasm'), full], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate() + assert err == '', 'bad err:' + err + + # verify output + expected_file = os.path.join('test', dot_s_dir, wasm) + if not os.path.exists(expected_file): + print actual + raise Exception('output ' + expected_file + ' does not exist') + expected = open(expected_file).read() + if actual != expected: + fail(actual, expected) - # verify with options - proc = subprocess.Popen([os.path.join('bin', 's2wasm'), full, '--global-base=1024'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) - out, err = proc.communicate() - assert proc.returncode == 0, err + # verify with options + proc = subprocess.Popen([os.path.join('bin', 's2wasm'), full, '--global-base=1024'], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + out, err = proc.communicate() + assert proc.returncode == 0, err print '\n[ checking torture testcases... ]\n' |