From 1005b1267f70a5a7cf7a8774af6c12d813464720 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 20 Oct 2017 19:38:31 -0700 Subject: Emit binary function index in comment in text format, for convenience (#1232) --- scripts/test/s2wasm.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'scripts/test/s2wasm.py') diff --git a/scripts/test/s2wasm.py b/scripts/test/s2wasm.py index b8027f668..405ed5fdf 100755 --- a/scripts/test/s2wasm.py +++ b/scripts/test/s2wasm.py @@ -119,7 +119,15 @@ def test_linker(): for name, extra in expected_funcs: space = ' ' if extra else '' fail_if_not_contained(output, '(export "{0}" (func ${0}))'.format(name)) - fail_if_not_contained(output, '(func ${0}'.format(name + space + extra)) + for line in output.split('\n'): + if '(func ${0}'.format(name + space) in line: + # we found the relevant line for the function definition. remove + # a (; X ;) comment with its index + start = line.find('(; ') + if start >= 0: + end = line.find(' ;)') + line = line[:start] + line[end + 4:] + fail_if_not_contained(line, '(func ${0}'.format(name + space + extra)) if __name__ == '__main__': -- cgit v1.2.3