From 044f25f66e8946073631f26bdfce5b4d21674063 Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Fri, 20 Mar 2020 14:23:26 -0400 Subject: [PATCH] Use an actual hello world program to test in test.py (#456) --- test.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/test.py b/test.py index 9a5cc35..a1bd4ca 100755 --- a/test.py +++ b/test.py @@ -52,7 +52,14 @@ def hack_emsdk(marker, replacement): # Set up -open('hello_world.cpp', 'w').write('int main() {}') +open('hello_world.c', 'w').write('''\ +#include + +int main() { + printf("Hello, world!\\n"); + return 0; +} +''') TAGS = json.loads(open('emscripten-releases-tags.txt').read()) @@ -69,7 +76,7 @@ print('building proper system libraries') def test_lib_building(emcc, use_asmjs_optimizer): def test_build(args, expected=None, unexpected=None): - checked_call_with_output(emcc + ' hello_world.cpp' + args, + checked_call_with_output(emcc + ' hello_world.c' + args, expected=expected, unexpected=unexpected, stderr=subprocess.STDOUT) @@ -149,12 +156,12 @@ run_emsdk('activate tot-upstream') assert old_config == open(os.path.expanduser('~/.emscripten.old')).read() # TODO; test on latest as well assert os.path.exists(LIBC), 'activation supplies prebuilt libc' -check_call(upstream_emcc + ' hello_world.cpp') +check_call(upstream_emcc + ' hello_world.c') print('test tot-fastcomp') run_emsdk('install tot-fastcomp') run_emsdk('activate tot-fastcomp') -check_call(fastcomp_emcc + ' hello_world.cpp') +check_call(fastcomp_emcc + ' hello_world.c') print('test specific release (old)') run_emsdk('install sdk-fastcomp-1.38.31-64bit')