Verified Commit f040fb0d authored by Davide Beatrici's avatar Davide Beatrici Committed by Ralph Giles
Browse files

CMakeLists.txt: specify working directory in add_test() directives



This is required for Windows because it doesn't have RPATH,
thus it fails to find Opus if it's not in the same directory
as the executables or in PATH.
Signed-off-by: Ralph Giles's avatarRalph Giles <giles@thaumas.net>
parent 19586c5a
......@@ -546,13 +546,13 @@ if(BUILD_TESTING)
if(OPUS_FIXED_POINT)
target_compile_definitions(test_opus_decode PRIVATE DISABLE_FLOAT_API)
endif()
add_test(NAME test_opus_decode COMMAND $<TARGET_FILE:test_opus_decode>)
add_test(NAME test_opus_decode COMMAND $<TARGET_FILE:test_opus_decode> WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_executable(test_opus_padding ${test_opus_padding_sources})
target_include_directories(test_opus_padding
PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(test_opus_padding PRIVATE opus)
add_test(NAME test_opus_padding COMMAND $<TARGET_FILE:test_opus_padding>)
add_test(NAME test_opus_padding COMMAND $<TARGET_FILE:test_opus_padding> WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
if(NOT BUILD_SHARED_LIBS)
# disable tests that depends on private API when building shared lib
......@@ -563,12 +563,12 @@ if(BUILD_TESTING)
if(OPUS_FIXED_POINT)
target_compile_definitions(test_opus_api PRIVATE DISABLE_FLOAT_API)
endif()
add_test(NAME test_opus_api COMMAND $<TARGET_FILE:test_opus_api>)
add_test(NAME test_opus_api COMMAND $<TARGET_FILE:test_opus_api> WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_executable(test_opus_encode ${test_opus_encode_sources})
target_include_directories(test_opus_encode
PRIVATE ${CMAKE_CURRENT_BINARY_DIR} celt)
target_link_libraries(test_opus_encode PRIVATE opus)
add_test(NAME test_opus_encode COMMAND $<TARGET_FILE:test_opus_encode>)
add_test(NAME test_opus_encode COMMAND $<TARGET_FILE:test_opus_encode> WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
endif()
endif()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment