From f56441820fc54ed9024511576e4ddb250dbc38e7 Mon Sep 17 00:00:00 2001 From: Gabriel Hege Date: Tue, 15 Oct 2024 14:42:27 +0200 Subject: [PATCH] ensure vvdecapp is built, when running the test suite even when -DVVDEC_LIBRARY_ONLY=1 is set --- CMakeLists.txt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 084be76b..e32004a4 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." )