Skip to content

Commit bfa17ce

Browse files
authored
Fix other.test_debuginfo_line_tables_only after racing landings (emscripten-core#9881)
1 parent c2b82bf commit bfa17ce

File tree

1 file changed

+17
-10
lines changed

1 file changed

+17
-10
lines changed

tests/test_other.py

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2338,23 +2338,30 @@ def test(do_compile):
23382338
line_size = os.path.getsize('a.out.wasm')
23392339
do_compile(['-g'])
23402340
full_size = os.path.getsize('a.out.wasm')
2341-
self.assertLess(no_size, line_size)
2342-
# currently we don't support full debug info anyhow, so line tables
2343-
# is all we have
2344-
self.assertEqual(line_size, full_size)
2341+
return (no_size, line_size, full_size)
23452342

2346-
def compile_directly(compile_args):
2347-
run_process([PYTHON, EMCC, path_from_root('tests', 'hello_world.cpp')] + compile_args)
2343+
def compile_to_object(compile_args):
2344+
run_process([PYTHON, EMCC, path_from_root('tests', 'hello_world.cpp'), '-c', '-o', 'a.out.wasm'] + compile_args)
23482345

2349-
test(compile_directly)
2346+
no_size, line_size, full_size = test(compile_to_object)
23502347

2351-
def compile_to_object_first(compile_args):
2348+
self.assertLess(no_size, line_size)
2349+
# currently we don't support full debug info anyhow, so line tables
2350+
# is all we have
2351+
self.assertEqual(line_size, full_size)
2352+
2353+
def compile_to_executable(compile_args):
23522354
# compile with the specified args
2353-
run_process([PYTHON, EMCC, path_from_root('tests', 'hello_world.cpp')] + compile_args + ['-c', '-o', 'a.o'])
2355+
run_process([PYTHON, EMCC, path_from_root('tests', 'hello_world.cpp'), '-c', '-o', 'a.o'] + compile_args)
23542356
# link with debug info
23552357
run_process([PYTHON, EMCC, 'a.o', '-g'])
23562358

2357-
test(compile_to_object_first)
2359+
no_size, line_size, full_size = test(compile_to_executable)
2360+
2361+
# currently we strip all debug info from the final wasm anyhow, until
2362+
# we have full dwarf support
2363+
self.assertEqual(no_size, line_size)
2364+
self.assertEqual(line_size, full_size)
23582365

23592366
@unittest.skipIf(not scons_path, 'scons not found in PATH')
23602367
@with_env_modify({'EMSCRIPTEN_ROOT': path_from_root()})

0 commit comments

Comments
 (0)