summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2021-01-27 23:31:09 +0000
committerGitHub <noreply@github.com>2021-01-27 15:31:09 -0800
commita5aa66c52e0b92597a3b90cf34ccc3b7dee775d0 (patch)
tree653b71fa0c6be8c84ea37f3045ab23b19a09ccd2
parent1b950a1c4eb7b1a0a1d71c7e68e223fe57fdff66 (diff)
downloadbinaryen-a5aa66c52e0b92597a3b90cf34ccc3b7dee775d0.tar.gz
binaryen-a5aa66c52e0b92597a3b90cf34ccc3b7dee775d0.tar.bz2
binaryen-a5aa66c52e0b92597a3b90cf34ccc3b7dee775d0.zip
Remove test suite's assumption of minify_check roundtripping perfectly (#3524)
minify_check checks that we can print and read minified wast. The test also, however, assumed that we round-trip such things perfectly. That's never been true, and only by chance did this go unnoticed until now, in #3523 The specific issue happening there is that we create a block without a name. Then we write that as text, then read it. When we read it, we give all such blocks a name (and we rely on optimizations to remove it later when possible - this avoids optimizing in the parser). The extra name looks like a bug to minify_check.
-rw-r--r--scripts/test/shared.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/scripts/test/shared.py b/scripts/test/shared.py
index f782bb849..670d41d30 100644
--- a/scripts/test/shared.py
+++ b/scripts/test/shared.py
@@ -492,19 +492,8 @@ def minify_check(wast, verify_final_result=True):
cmd = WASM_OPT + [wast, '--print-minified', '-all']
print(' ', ' '.join(cmd))
subprocess.check_call(cmd, stdout=open('a.wast', 'w'), stderr=subprocess.PIPE)
- assert os.path.exists('a.wast')
- subprocess.check_call(WASM_OPT + ['a.wast', '--print-minified', '-all'],
- stdout=open('b.wast', 'w'), stderr=subprocess.PIPE)
- assert os.path.exists('b.wast')
- if verify_final_result:
- expected = open('a.wast').read()
- actual = open('b.wast').read()
- if actual != expected:
- fail(actual, expected)
- if os.path.exists('a.wast'):
- os.unlink('a.wast')
- if os.path.exists('b.wast'):
- os.unlink('b.wast')
+ subprocess.check_call(WASM_OPT + ['a.wast', '-all'],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
# run a check with BINARYEN_PASS_DEBUG set, to do full validation