Skip to content

Commit

Permalink
Use an actual hello world program to test in test.py (emscripten-core…
Browse files Browse the repository at this point in the history
  • Loading branch information
sbc100 authored Mar 20, 2020
1 parent 7e689a5 commit 044f25f
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdio.h>
int main() {
printf("Hello, world!\\n");
return 0;
}
''')

TAGS = json.loads(open('emscripten-releases-tags.txt').read())

Expand All @@ -69,7 +76,7 @@ def hack_emsdk(marker, replacement):

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)
Expand Down Expand Up @@ -149,12 +156,12 @@ def run_emsdk(cmd):
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')
Expand Down

0 comments on commit 044f25f

Please sign in to comment.