Skip to content

Commit

Permalink
Audio, WavAudioImporter: bundle test files for Emscripten.
Browse files Browse the repository at this point in the history
  • Loading branch information
mosra committed Sep 1, 2016
1 parent 5bc9ab1 commit d4819b3
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/Magnum/Audio/Test/CMakeLists.txt
Expand Up @@ -24,6 +24,12 @@
# DEALINGS IN THE SOFTWARE.
#

if(CORRADE_TARGET_EMSCRIPTEN)
set(AUDIO_TEST_DIR "")
else()
set(AUDIO_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/configure.h)

Expand All @@ -38,3 +44,7 @@ if(WITH_SCENEGRAPH)
corrade_add_test(AudioListenerTest ListenerTest.cpp LIBRARIES MagnumSceneGraph MagnumAudio)
corrade_add_test(AudioPlayableTest PlayableTest.cpp LIBRARIES MagnumSceneGraph MagnumAudio)
endif()

if(CORRADE_TARGET_EMSCRIPTEN)
emscripten_embed_file(AudioAbstractImporterTest file.bin "/file.bin")
endif()
2 changes: 1 addition & 1 deletion src/Magnum/Audio/Test/configure.h.cmake
Expand Up @@ -23,4 +23,4 @@
DEALINGS IN THE SOFTWARE.
*/

#define AUDIO_TEST_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
#define AUDIO_TEST_DIR "${AUDIO_TEST_DIR}"
14 changes: 14 additions & 0 deletions src/MagnumPlugins/WavAudioImporter/Test/CMakeLists.txt
Expand Up @@ -23,8 +23,22 @@
# DEALINGS IN THE SOFTWARE.
#

if(CORRADE_TARGET_EMSCRIPTEN)
set(WAVAUDIOIMPORTER_TEST_DIR "")
else()
set(WAVAUDIOIMPORTER_TEST_DIR ${CMAKE_CURRENT_SOURCE_DIR})
endif()

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/configure.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/configure.h)

corrade_add_test(WavAudioImporterTest WavImporterTest.cpp LIBRARIES MagnumWavAudioImporterTestLib)
target_include_directories(WavAudioImporterTest PRIVATE ${CMAKE_CURRENT_BINARY_DIR})

if(CORRADE_TARGET_EMSCRIPTEN)
emscripten_embed_file(WavAudioImporterTest mono16.wav "/mono16.wav")
emscripten_embed_file(WavAudioImporterTest stereo8.wav "/stereo8.wav")
emscripten_embed_file(WavAudioImporterTest unsupportedChannelCount.wav "/unsupportedChannelCount.wav")
emscripten_embed_file(WavAudioImporterTest unsupportedFormat.wav "/unsupportedFormat.wav")
emscripten_embed_file(WavAudioImporterTest wrongSignature.wav "/wrongSignature.wav")
endif()
2 changes: 1 addition & 1 deletion src/MagnumPlugins/WavAudioImporter/Test/configure.h.cmake
Expand Up @@ -23,4 +23,4 @@
DEALINGS IN THE SOFTWARE.
*/

#define WAVAUDIOIMPORTER_TEST_DIR "${CMAKE_CURRENT_SOURCE_DIR}"
#define WAVAUDIOIMPORTER_TEST_DIR "${WAVAUDIOIMPORTER_TEST_DIR}"

0 comments on commit d4819b3

Please sign in to comment.