From a5aa66c52e0b92597a3b90cf34ccc3b7dee775d0 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Wed, 27 Jan 2021 23:31:09 +0000 Subject: 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. --- scripts/test/shared.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'scripts/test') 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 -- cgit v1.2.3