@@ -2338,23 +2338,30 @@ def test(do_compile):
2338
2338
line_size = os .path .getsize ('a.out.wasm' )
2339
2339
do_compile (['-g' ])
2340
2340
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 )
2345
2342
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 )
2348
2345
2349
- test (compile_directly )
2346
+ no_size , line_size , full_size = test (compile_to_object )
2350
2347
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 ):
2352
2354
# 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 )
2354
2356
# link with debug info
2355
2357
run_process ([PYTHON , EMCC , 'a.o' , '-g' ])
2356
2358
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 )
2358
2365
2359
2366
@unittest .skipIf (not scons_path , 'scons not found in PATH' )
2360
2367
@with_env_modify ({'EMSCRIPTEN_ROOT' : path_from_root ()})
0 commit comments