@@ -2756,7 +2756,7 @@ def test_file_packager_embed(self):
27562756 err = self .run_process ([FILE_PACKAGER , 'test.data' , '--embed' , 'data.txt' , '--js-output=data.js' ], stderr = PIPE ).stderr
27572757 self .assertContained ('--obj-output is recommended when using --embed' , err )
27582758
2759- self .run_process ([FILE_PACKAGER , 'test.data' , '--embed' , 'data.txt' , '--obj-output=data.o' , '--js-output=data.js' ])
2759+ self .run_process ([FILE_PACKAGER , 'test.data' , '--embed' , 'data.txt' , '--obj-output=data.o' ])
27602760
27612761 create_file ('test.c' , '''
27622762 #include <stdio.h>
@@ -2771,7 +2771,7 @@ def test_file_packager_embed(self):
27712771 return 0;
27722772 }
27732773 ''' )
2774- self .run_process ([EMCC , '--pre-js=data.js' , ' test.c' , 'data.o' , '-sFORCE_FILESYSTEM' ])
2774+ self .run_process ([EMCC , 'test.c' , 'data.o' , '-sFORCE_FILESYSTEM' ])
27752775 output = self .run_js ('a.out.js' )
27762776 self .assertContained ('hello data' , output )
27772777
@@ -5956,9 +5956,9 @@ def test_ld_library_path(self):
59565956}
59575957''' )
59585958 create_file ('pre.js' , r'''
5959- Module['preRun'].push( function (){
5959+ Module['preRun'] = function () {
59605960 ENV['LD_LIBRARY_PATH']='/lib:/usr/lib';
5961- }) ;
5961+ };
59625962''' )
59635963 create_file ('main.c' , r'''
59645964#include <stdio.h>
@@ -9909,19 +9909,19 @@ def test_files_and_module_assignment(self):
99099909 # a pre-js can set Module to a new object or otherwise undo file preloading/
99109910 # embedding changes to Module.preRun. we show an error to avoid confusion
99119911 create_file ('pre.js' , 'Module = {};' )
9912- create_file ('src.cpp ' , r'''
9912+ create_file ('src.c ' , r'''
99139913 #include <stdio.h>
99149914 int main() {
9915- printf("file exists: %d \n", !! fopen("src.cpp", "rb"));
9915+ printf("file exists: %p \n", fopen("src.cpp", "rb"));
99169916 }
99179917 ''' )
9918- self .run_process ([EMXX , 'src.cpp ' , '--pre-js' , ' pre.js' , '--embed -file' , ' src.cpp ' ])
9918+ self .run_process ([EMCC , 'src.c ' , '--pre-js= pre.js' , '--preload -file= src.c ' ])
99199919 result = self .run_js ('a.out.js' , assert_returncode = NON_ZERO )
99209920 self .assertContained ('Module.preRun should exist because file support used it; did a pre-js delete it?' , result )
99219921
99229922 def test_error (pre ):
99239923 create_file ('pre.js' , pre )
9924- self .run_process ([EMXX , 'src.cpp ' , '--pre-js' , ' pre.js' , '--embed -file' , ' src.cpp ' ])
9924+ self .run_process ([EMXX , 'src.c ' , '--pre-js= pre.js' , '--preload -file= src.c ' ])
99259925 result = self .run_js ('a.out.js' , assert_returncode = NON_ZERO )
99269926 self .assertContained ('All preRun tasks that exist before user pre-js code should remain after; did you replace Module or modify Module.preRun?' , result )
99279927
0 commit comments