diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index efac921d..8ce2b778 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -30,13 +30,17 @@ endif() # Link needed libraries target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main) -# Copy test files to testing directory -add_subdirectory(TestBitStreams) -file(COPY ${TESTBITSTREAMS} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) -# Copy LXFML test files to the build directory where the executable runs from +# Copy test files to the build directory where the executable runs from # Use a custom command to ensure files are copied when the target is built add_custom_command(TARGET dCommonTests POST_BUILD + # Copy AMF test files + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_CURRENT_BINARY_DIR}/AMFBitStreamTest.bin" + "$/AMFBitStreamTest.bin" + COMMAND ${CMAKE_COMMAND} -E copy_if_different + "${CMAKE_CURRENT_BINARY_DIR}/AMFBitStreamUnimplementedTest.bin" + "$/AMFBitStreamUnimplementedTest.bin" COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/LxfmlTestFiles/test.lxfml" "$/test.lxfml" @@ -64,8 +68,8 @@ add_custom_command(TARGET dCommonTests POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/LxfmlTestFiles/deeply_nested.lxfml" "$/deeply_nested.lxfml" - COMMENT "Copying LXFML test files to executable directory" + COMMENT "Copying test files to executable directory" ) -# Discover the tests and set working directory to where the executable and test files are -gtest_discover_tests(dCommonTests WORKING_DIRECTORY "$") +# Discover the tests +gtest_discover_tests(dCommonTests)