aboutsummaryrefslogtreecommitdiff
path: root/tests/runner.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/runner.py')
-rwxr-xr-xtests/runner.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/runner.py b/tests/runner.py
index 7f8c2d87..04baf47b 100755
--- a/tests/runner.py
+++ b/tests/runner.py
@@ -10496,6 +10496,24 @@ f.close()
self.assertContained('result: 1', run_js(os.path.join(self.get_dir(), 'a.out.js')))
+ def test_export_all(self):
+ lib = r'''
+ #include <stdio.h>
+ void libf1() { printf("libf1\n"); }
+ void libf2() { printf("libf2\n"); }
+ '''
+ lib_name = os.path.join(self.get_dir(), 'lib.c')
+ open(lib_name, 'w').write(lib)
+
+ open('main.js', 'w').write('''
+ _libf1();
+ _libf2();
+ ''')
+
+ Building.emcc(lib_name, ['-s', 'EXPORT_ALL=1', '--post-js', 'main.js'], output_filename='a.out.js')
+
+ self.assertContained('libf1\nlibf2\n', run_js(os.path.join(self.get_dir(), 'a.out.js')))
+
def test_abspaths(self):
# Includes with absolute paths are generally dangerous, things like -I/usr/.. will get to system local headers, not our portable ones.
@@ -12290,9 +12308,10 @@ elif 'browser' in str(sys.argv):
def test_sdl_audio_mix(self):
shutil.copyfile(path_from_root('tests', 'sounds', 'pluck.ogg'), os.path.join(self.get_dir(), 'sound.ogg'))
shutil.copyfile(path_from_root('tests', 'sounds', 'the_entertainer.ogg'), os.path.join(self.get_dir(), 'music.ogg'))
+ shutil.copyfile(path_from_root('tests', 'sounds', 'noise.ogg'), os.path.join(self.get_dir(), 'noise.ogg'))
open(os.path.join(self.get_dir(), 'sdl_audio_mix.c'), 'w').write(self.with_report_result(open(path_from_root('tests', 'sdl_audio_mix.c')).read()))
- Popen([PYTHON, EMCC, '-O2', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio_mix.c'), '--preload-file', 'sound.ogg', '--preload-file', 'music.ogg', '-o', 'page.html']).communicate()
+ Popen([PYTHON, EMCC, '-O2', '--minify', '0', os.path.join(self.get_dir(), 'sdl_audio_mix.c'), '--preload-file', 'sound.ogg', '--preload-file', 'music.ogg', '--preload-file', 'noise.ogg', '-o', 'page.html']).communicate()
self.run_browser('page.html', '', '/report_result?1')
def test_sdl_audio_quickload(self):