@@ -56,11 +56,11 @@ def test_sdl2_togglefullscreen(self):
56
56
self .btest_exit ('sdl_togglefullscreen.c' , args = ['-sUSE_SDL=2' ])
57
57
58
58
def test_sdl_audio (self ):
59
- shutil .copyfile (test_file ('sounds' , 'alarmvictory_1.ogg' ), os . path . join ( self .get_dir (), 'sound.ogg' ))
60
- shutil .copyfile (test_file ('sounds' , 'alarmcreatemiltaryfoot_1.wav' ), os . path . join ( self .get_dir (), 'sound2.wav' ))
61
- shutil .copyfile (test_file ('sounds' , 'noise.ogg' ), os . path . join ( self .get_dir (), 'noise.ogg' ))
62
- shutil .copyfile (test_file ('sounds' , 'the_entertainer.ogg' ), os . path . join ( self .get_dir (), 'the_entertainer.ogg' ))
63
- open (os . path . join ( self .get_dir (), 'bad.ogg' ), 'w' ).write ('I claim to be audio, but am lying' )
59
+ shutil .copyfile (test_file ('sounds' , 'alarmvictory_1.ogg' ), self .in_dir ( 'sound.ogg' ))
60
+ shutil .copyfile (test_file ('sounds' , 'alarmcreatemiltaryfoot_1.wav' ), self .in_dir ( 'sound2.wav' ))
61
+ shutil .copyfile (test_file ('sounds' , 'noise.ogg' ), self .in_dir ( 'noise.ogg' ))
62
+ shutil .copyfile (test_file ('sounds' , 'the_entertainer.ogg' ), self .in_dir ( 'the_entertainer.ogg' ))
63
+ open (self .in_dir ( 'bad.ogg' ), 'w' ).write ('I claim to be audio, but am lying' )
64
64
65
65
# use closure to check for a possible bug with closure minifying away newer Audio() attributes
66
66
self .btest_exit (test_file ('sdl_audio.c' ), args = ['--preload-file' , 'sound.ogg' , '--preload-file' , 'sound2.wav' , '--embed-file' , 'the_entertainer.ogg' , '--preload-file' , 'noise.ogg' , '--preload-file' , 'bad.ogg' ])
@@ -71,15 +71,15 @@ def test_sdl_audio(self):
71
71
# depended on fragile SDL1/SDL2 mixing, which stopped working with
72
72
# 7a5744d754e00bec4422405a1a94f60b8e53c8fc (which just uncovered
73
73
# the existing problem)
74
- # self.run_process([EMCC, '-O1', '--closure', '0', '--minify=0', os.path.join( self.get_dir(), 'sdl_audio.c'), '--preload-file', 'sound.ogg', '--preload-file', 'sound2.wav', '--embed-file', 'the_entertainer.ogg', '--preload-file', 'noise.ogg', '--preload-file', 'bad.ogg', '-o', 'page.html', '-sEXPORTED_FUNCTIONS=[_main,_play,_play2', '-sUSE_SDL=2', '-DUSE_SDL2']).communicate()
74
+ # self.run_process([EMCC, '-O1', '--closure', '0', '--minify=0', self.in_dir( 'sdl_audio.c'), '--preload-file', 'sound.ogg', '--preload-file', 'sound2.wav', '--embed-file', 'the_entertainer.ogg', '--preload-file', 'noise.ogg', '--preload-file', 'bad.ogg', '-o', 'page.html', '-sEXPORTED_FUNCTIONS=[_main,_play,_play2', '-sUSE_SDL=2', '-DUSE_SDL2']).communicate()
75
75
# self.run_browser('page.html', '', '/report_result?1')
76
76
77
77
@parameterized ({
78
78
'' : ([],),
79
79
'wasmfs' : (['-sWASMFS' ],),
80
80
})
81
81
def test_sdl_audio_mix_channels (self , args ):
82
- shutil .copyfile (test_file ('sounds' , 'noise.ogg' ), os . path . join ( self .get_dir (), 'sound.ogg' ))
82
+ shutil .copyfile (test_file ('sounds' , 'noise.ogg' ), self .in_dir ( 'sound.ogg' ))
83
83
84
84
self .btest_exit ('sdl_audio_mix_channels.c' , args = ['-O2' , '--minify=0' , '--preload-file' , 'sound.ogg' ] + args )
85
85
@@ -88,14 +88,14 @@ def test_sdl_audio_mix_channels(self, args):
88
88
'wasmfs' : (['-sWASMFS' ],),
89
89
})
90
90
def test_sdl_audio_mix (self , args ):
91
- shutil .copyfile (test_file ('sounds' , 'pluck.ogg' ), os . path . join ( self .get_dir (), 'sound.ogg' ))
92
- shutil .copyfile (test_file ('sounds' , 'the_entertainer.ogg' ), os . path . join ( self .get_dir (), 'music.ogg' ))
93
- shutil .copyfile (test_file ('sounds' , 'noise.ogg' ), os . path . join ( self .get_dir (), 'noise.ogg' ))
91
+ shutil .copyfile (test_file ('sounds' , 'pluck.ogg' ), self .in_dir ( 'sound.ogg' ))
92
+ shutil .copyfile (test_file ('sounds' , 'the_entertainer.ogg' ), self .in_dir ( 'music.ogg' ))
93
+ shutil .copyfile (test_file ('sounds' , 'noise.ogg' ), self .in_dir ( 'noise.ogg' ))
94
94
95
95
self .btest_exit ('sdl_audio_mix.c' , args = ['-O2' , '--minify=0' , '--preload-file' , 'sound.ogg' , '--preload-file' , 'music.ogg' , '--preload-file' , 'noise.ogg' ] + args )
96
96
97
97
def test_sdl_audio_panning (self ):
98
- shutil .copyfile (test_file ('sounds' , 'the_entertainer.wav' ), os . path . join ( self .get_dir (), 'the_entertainer.wav' ))
98
+ shutil .copyfile (test_file ('sounds' , 'the_entertainer.wav' ), self .in_dir ( 'the_entertainer.wav' ))
99
99
100
100
# use closure to check for a possible bug with closure minifying away newer Audio() attributes
101
101
self .btest_exit ('sdl_audio_panning.c' , args = ['-O2' , '--closure=1' , '--minify=0' , '--preload-file' , 'the_entertainer.wav' , '-sEXPORTED_FUNCTIONS=_main,_play' ])
@@ -138,7 +138,7 @@ def test_sdl2_audio_beeps(self):
138
138
self .btest_exit (test_file ('sdl2_audio_beep.cpp' ), args = ['-O2' , '--closure=1' , '--minify=0' , '-sDISABLE_EXCEPTION_CATCHING=0' , '-sUSE_SDL=2' ])
139
139
140
140
def test_openal_playback (self ):
141
- shutil .copyfile (test_file ('sounds' , 'audio.wav' ), os . path . join ( self .get_dir (), 'audio.wav' ))
141
+ shutil .copyfile (test_file ('sounds' , 'audio.wav' ), self .in_dir ( 'audio.wav' ))
142
142
143
143
for args in [[], ['-sUSE_PTHREADS' , '-sPROXY_TO_PTHREAD' ]]:
144
144
self .compile_btest (['-O2' , test_file ('openal_playback.cpp' ), '--preload-file' , 'audio.wav' , '-o' , 'page.html' ] + args )
0 commit comments