Skip to content

Update emsymbolizer and emsize tests #21305

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions test/other/test_emsize.out
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
section size addr
TYPE 51 0
IMPORT 31 0
FUNCTION 14 0
GLOBAL 9 0
EXPORT 9 0
ELEM 9 0
CODE 1556 0
DATA 77 0
TYPE 51 10
IMPORT 31 63
FUNCTION 14 96
GLOBAL 9 112
EXPORT 9 123
ELEM 9 134
CODE 1556 146
DATA 77 1704
JS 6756 0
Total 8512
8 changes: 3 additions & 5 deletions test/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,6 @@ def test_em_config_missing_arg(self):
out = self.expect_fail([EMCC, '--em-config'])
self.assertContained('error: --em-config must be followed by a filename', out)

@disabled('Updating underlying tool output')
Copy link
Member

@kripken kripken Feb 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is it that this test can be re-enabled without any changes? I thought it was disabled so that something can roll in, but that suggests the test errored on those things and needed some change to fix that, but maybe I'm confused.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like expectations file for this test (test/other/test_emsize.out) was updated.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the changes to test_emsize.out make this test pass again.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, sorry, I misread the diff.

def test_emsize(self):
# test binaryen generated by running:
# emcc test/hello_world.c -Oz --closure 1 -o test/other/test_emsize.js
Expand Down Expand Up @@ -9701,11 +9700,10 @@ def test(dump_file):
test('foo.wasm.dump')
test('bar.wasm.dump')

@disabled('Updating underlying tool output')
def test_emsymbolizer(self):
def check_dwarf_loc_info(address, funcs, locs):
out = self.run_process(
[emsymbolizer, '-tcode', '-s', 'dwarf', 'test_dwarf.wasm', address],
[emsymbolizer, '-s', 'dwarf', 'test_dwarf.wasm', address],
stdout=PIPE).stdout
for func in funcs:
self.assertIn(func, out)
Expand All @@ -9714,7 +9712,7 @@ def check_dwarf_loc_info(address, funcs, locs):

def check_source_map_loc_info(address, loc):
out = self.run_process(
[emsymbolizer, '-tcode', '-s', 'sourcemap', 'test_dwarf.wasm',
[emsymbolizer, '-s', 'sourcemap', 'test_dwarf.wasm',
address],
stdout=PIPE).stdout
self.assertIn(loc, out)
Expand All @@ -9727,7 +9725,7 @@ def check_source_map_loc_info(address, loc):
# ...
# 6: 41 00 i32.const 0
# ...
# The addresses here are the offsets to start of the code section. Returns
# The addresses here are the offsets to the start of the file. Returns
# the address string in hexadecimal.
def get_addr(text):
out = self.run_process([common.LLVM_OBJDUMP, '-d', 'test_dwarf.wasm'],
Expand Down