Skip to content

Commit e49e05f

Browse files
authored
[test] Use common hello world program. NFC (#23399)
1 parent c16b644 commit e49e05f

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

test/test_sanity.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -439,20 +439,13 @@ def test_FROZEN_CACHE(self):
439439
def test_emcc_multiprocess_cache_access(self):
440440
restore_and_set_up()
441441

442-
create_file('test.c', r'''
443-
#include <stdio.h>
444-
int main() {
445-
printf("hello, world!\n");
446-
return 0;
447-
}
448-
''')
449442
cache_dir_name = self.in_dir('test_cache')
450443
libname = cache.get_lib_name('libc.a')
451444
with env_modify({'EM_CACHE': cache_dir_name}):
452445
tasks = []
453446
num_times_libc_was_built = 0
454447
for i in range(3):
455-
p = self.run_process([EMCC, 'test.c', '-O2', '-o', '%d.js' % i], stderr=STDOUT, stdout=PIPE)
448+
p = self.run_process([EMCC, test_file('hello_world.c'), '-O2', '-o', '%d.js' % i], stderr=STDOUT, stdout=PIPE)
456449
tasks += [p]
457450
for p in tasks:
458451
print('stdout:\n', p.stdout)
@@ -479,19 +472,12 @@ def test_emcc_cache_flag(self, use_response_files, relative):
479472
else:
480473
cache_dir_name = self.in_dir('emscripten_cache')
481474
self.assertFalse(os.path.exists(cache_dir_name))
482-
create_file('test.c', r'''
483-
#include <stdio.h>
484-
int main() {
485-
printf("hello, world!\n");
486-
return 0;
487-
}
488-
''')
489475
args = ['--cache', cache_dir_name]
490476
if use_response_files:
491477
rsp = response_file.create_response_file(args, shared.TEMP_DIR)
492478
args = ['@' + rsp]
493479

494-
self.run_process([EMCC, 'test.c'] + args, stderr=PIPE)
480+
self.run_process([EMCC, test_file('hello_world.c')] + args, stderr=PIPE)
495481
if use_response_files:
496482
os.remove(rsp)
497483

0 commit comments

Comments
 (0)