diff --git a/test/doublestart.c b/test/browser/test_doublestart_bug.c similarity index 92% rename from test/doublestart.c rename to test/browser/test_doublestart_bug.c index aa1421421a2c6..c50b13d40c47c 100644 --- a/test/doublestart.c +++ b/test/browser/test_doublestart_bug.c @@ -5,13 +5,14 @@ * found in the LICENSE file. */ +#include #include #include int times = 0; void later(void* nada) { - REPORT_RESULT(times); + exit(0); } void main_loop(void) { @@ -21,6 +22,7 @@ void main_loop(void) { int main(void) { emscripten_async_call(later, NULL, 2000); + assert(times == 0); times++; printf("This should only appear once.\n"); emscripten_set_main_loop(main_loop, 10, 0); diff --git a/test/browser/glew.c b/test/browser/test_glew.c similarity index 97% rename from test/browser/glew.c rename to test/browser/test_glew.c index 3477c3784c410..c534e6f7fde63 100644 --- a/test/browser/glew.c +++ b/test/browser/test_glew.c @@ -49,8 +49,5 @@ int main() { assert(glewIsSupported("GL_EXT_texture_filter_anisotropic GL_EXT_framebuffer_object") == 1); } -#ifdef REPORT_RESULT - REPORT_RESULT(1); -#endif return 0; } diff --git a/test/openal/test_openal_playback.c b/test/openal/test_openal_playback.c index 8aac17ce3e31b..c34dbdda09e36 100644 --- a/test/openal/test_openal_playback.c +++ b/test/openal/test_openal_playback.c @@ -16,14 +16,11 @@ #include #endif -#ifndef EMSCRIPTEN_KEEPALIVE -#define EMSCRIPTEN_KEEPALIVE -#endif - -void EMSCRIPTEN_KEEPALIVE test_finished() { -#ifdef REPORT_RESULT - REPORT_RESULT(1); +#ifdef __EMSCRIPTEN__ +EMSCRIPTEN_KEEPALIVE #endif +void test_finished() { + exit(0); } #if defined(TEST_ALC_SOFT_PAUSE_DEVICE) diff --git a/test/test_browser.py b/test/test_browser.py index e9bda0bd0bc62..089a0da22de91 100644 --- a/test/test_browser.py +++ b/test/test_browser.py @@ -2520,11 +2520,14 @@ def test_uuid(self): self.btest_exit('test_uuid.c', cflags=['-luuid']) @requires_graphics_hardware - def test_glew(self): - self.btest('glew.c', cflags=['-lGL', '-lSDL', '-lGLEW'], expected='1') - self.btest('glew.c', cflags=['-lGL', '-lSDL', '-lGLEW', '-sLEGACY_GL_EMULATION'], expected='1') - self.btest('glew.c', cflags=['-lGL', '-lSDL', '-lGLEW', '-DGLEW_MX'], expected='1') - self.btest('glew.c', cflags=['-lGL', '-lSDL', '-lGLEW', '-sLEGACY_GL_EMULATION', '-DGLEW_MX'], expected='1') + @parameterized({ + '': ([],), + 'glemu': (['-sLEGACY_GL_EMULATION'],), + 'mx': (['-DGLEW_MX'],), + 'glemu_mx': (['-sLEGACY_GL_EMULATION', '-DGLEW_MX'],), + }) + def test_glew(self, args): + self.btest_exit('test_glew.c', cflags=['-lGL', '-lSDL', '-lGLEW'] + args) def test_doublestart_bug(self): self.set_setting('DEFAULT_LIBRARY_FUNCS_TO_INCLUDE', '$addRunDependency,$removeRunDependency') @@ -2535,7 +2538,7 @@ def test_doublestart_bug(self): }; ''') - self.btest('doublestart.c', cflags=['--pre-js', 'pre.js'], expected='1') + self.btest_exit('test_doublestart_bug.c', cflags=['--pre-js', 'pre.js']) @parameterized({ '': ([],), diff --git a/test/test_interactive.py b/test/test_interactive.py index 0a40943b71706..4677df2e607ea 100644 --- a/test/test_interactive.py +++ b/test/test_interactive.py @@ -158,7 +158,7 @@ def test_sdl2_audio_beeps(self): }) def test_openal_playback(self, args): copy_asset('sounds/audio.wav') - self.btest('openal/test_openal_playback.c', '1', cflags=['-O2', '--preload-file', 'audio.wav'] + args) + self.btest_exit('openal/test_openal_playback.c', cflags=['-O2', '--preload-file', 'audio.wav'] + args) def test_openal_buffers(self): self.btest_exit('openal/test_openal_buffers.c', cflags=['-DTEST_INTERACTIVE=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/']) @@ -167,34 +167,34 @@ def test_openal_buffers_animated_pitch(self): self.btest_exit('openal/test_openal_buffers.c', cflags=['-DTEST_INTERACTIVE=1', '-DTEST_ANIMATED_PITCH=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/']) def test_openal_looped_pitched_playback(self): - self.btest('openal/test_openal_playback.c', '1', cflags=['-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) + self.btest_exit('openal/test_openal_playback.c', cflags=['-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) def test_openal_looped_seek_playback(self): - self.btest('openal/test_openal_playback.c', '1', cflags=['-DTEST_LOOPED_SEEK_PLAYBACK=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) + self.btest_exit('openal/test_openal_playback.c', cflags=['-DTEST_LOOPED_SEEK_PLAYBACK=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) def test_openal_animated_looped_pitched_playback(self): - self.btest('openal/test_openal_playback.c', '1', cflags=['-DTEST_ANIMATED_LOOPED_PITCHED_PLAYBACK=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) + self.btest_exit('openal/test_openal_playback.c', cflags=['-DTEST_ANIMATED_LOOPED_PITCHED_PLAYBACK=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) def test_openal_animated_looped_distance_playback(self): - self.btest('openal/test_openal_playback.c', '1', cflags=['-DTEST_ANIMATED_LOOPED_DISTANCE_PLAYBACK=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) + self.btest_exit('openal/test_openal_playback.c', cflags=['-DTEST_ANIMATED_LOOPED_DISTANCE_PLAYBACK=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) def test_openal_animated_looped_doppler_playback(self): - self.btest('openal/test_openal_playback.c', '1', cflags=['-DTEST_ANIMATED_LOOPED_DOPPLER_PLAYBACK=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) + self.btest_exit('openal/test_openal_playback.c', cflags=['-DTEST_ANIMATED_LOOPED_DOPPLER_PLAYBACK=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) def test_openal_animated_looped_panned_playback(self): - self.btest('openal/test_openal_playback.c', '1', cflags=['-DTEST_ANIMATED_LOOPED_PANNED_PLAYBACK=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) + self.btest_exit('openal/test_openal_playback.c', cflags=['-DTEST_ANIMATED_LOOPED_PANNED_PLAYBACK=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) def test_openal_animated_looped_relative_playback(self): - self.btest('openal/test_openal_playback.c', '1', cflags=['-DTEST_ANIMATED_LOOPED_RELATIVE_PLAYBACK=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) + self.btest_exit('openal/test_openal_playback.c', cflags=['-DTEST_ANIMATED_LOOPED_RELATIVE_PLAYBACK=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) def test_openal_al_soft_loop_points(self): - self.btest('openal/test_openal_playback.c', '1', cflags=['-DTEST_AL_SOFT_LOOP_POINTS=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) + self.btest_exit('openal/test_openal_playback.c', cflags=['-DTEST_AL_SOFT_LOOP_POINTS=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) def test_openal_alc_soft_pause_device(self): - self.btest('openal/test_openal_playback.c', '1', cflags=['-DTEST_ALC_SOFT_PAUSE_DEVICE=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) + self.btest_exit('openal/test_openal_playback.c', cflags=['-DTEST_ALC_SOFT_PAUSE_DEVICE=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) def test_openal_al_soft_source_spatialize(self): - self.btest('openal/test_openal_playback.c', '1', cflags=['-DTEST_AL_SOFT_SOURCE_SPATIALIZE=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) + self.btest_exit('openal/test_openal_playback.c', cflags=['-DTEST_AL_SOFT_SOURCE_SPATIALIZE=1', '-DTEST_LOOPED_PLAYBACK=1', '--preload-file', test_file('sounds/the_entertainer.wav') + '@/audio.wav']) def test_openal_capture(self): self.btest_exit('openal/test_openal_capture.c')