diff --git a/CMakeLists.txt b/CMakeLists.txt index 084be76b..8b2a388d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -429,10 +429,15 @@ endforeach() get_directory_property( ALL_TESTS TESTS ) set_tests_properties( ${ALL_TESTS} PROPERTIES TIMEOUT 120 - FAIL_REGULAR_EXPRESSION "(WARNING:|runtime error)" ) + FAIL_REGULAR_EXPRESSION "(WARNING:|runtime error)" + FIXTURES_REQUIRED "BuildTestBinaries" ) -add_custom_target( test-ok USES_TERMINAL COMMAND ${CMAKE_CTEST_COMMAND} -C $ -R "\"^(Test|MISSING)\"" ) -add_custom_target( test-all USES_TERMINAL COMMAND ${CMAKE_CTEST_COMMAND} -C $ -R "\"^(Test|MISSING|Faulty)\"" ) +# ensure vvdecapp is built before the tests (as a test case setup fixture) +add_test( NAME "build test binaries" COMMAND ${CMAKE_COMMAND} --build "${CMAKE_BINARY_DIR}" --config "$" --target vvdecapp ) +set_tests_properties( "build test binaries" PROPERTIES FIXTURES_SETUP BuildTestBinaries TIMEOUT 0 ) + +add_custom_target( test-ok USES_TERMINAL COMMAND ${CMAKE_CTEST_COMMAND} -C $ -R "\"^(Test|MISSING)\"" DEPENDS vvdecapp ) +add_custom_target( test-all USES_TERMINAL COMMAND ${CMAKE_CTEST_COMMAND} -C $ -R "\"^(Test|MISSING|Faulty)\"" DEPENDS vvdecapp ) if( MISSING_BITSTREAM_FILES ) message( STATUS "Some bitstream files are missing." )