Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion test/doublestart.c → test/browser/test_doublestart_bug.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
* found in the LICENSE file.
*/

#include <assert.h>
#include <stdio.h>
#include <emscripten.h>

int times = 0;

void later(void* nada) {
REPORT_RESULT(times);
exit(0);
}

void main_loop(void) {
Expand All @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions test/browser/glew.c → test/browser/test_glew.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
11 changes: 4 additions & 7 deletions test/openal/test_openal_playback.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,11 @@
#include <emscripten.h>
#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)
Expand Down
15 changes: 9 additions & 6 deletions test/test_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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({
'': ([],),
Expand Down
22 changes: 11 additions & 11 deletions test/test_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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') + '@/'])
Expand All @@ -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')
Expand Down
Loading