Skip to content

Commit

Permalink
simplify dependency handling of unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
derselbst authored and mawe42 committed Apr 21, 2018
1 parent 7987446 commit c433fc8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
5 changes: 5 additions & 0 deletions cmake_admin/FluidUnitTest.cmake
Expand Up @@ -11,5 +11,10 @@ macro ( ADD_FLUID_TEST _test )
$<TARGET_PROPERTY:libfluidsynth,INCLUDE_DIRECTORIES> # include all other header search paths needed by libfluidsynth (esp. glib)
)

# add the test to ctest
ADD_TEST(NAME ${_test} COMMAND ${_test})

# append the current unit test to check-target as dependency
add_dependencies(check ${_test})

endmacro ( ADD_FLUID_TEST )
27 changes: 4 additions & 23 deletions test/CMakeLists.txt
Expand Up @@ -4,6 +4,10 @@ project(fluidsynth-test)
ENABLE_TESTING()
include ( FluidUnitTest )

# first define the test target, used by the macros below
add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIG> --output-on-failure)


## add unit tests here ##
ADD_FLUID_TEST(test_sample_cache)
ADD_FLUID_TEST(test_sfont_loading)
Expand All @@ -14,26 +18,3 @@ if ( LIBSNDFILE_HASVORBIS )
ADD_FLUID_TEST(test_sf3_sfont_loading)
ADD_FLUID_TEST(test_sf3_defsfont_preset_iteration)
endif ( LIBSNDFILE_HASVORBIS )


if ( LIBSNDFILE_HASVORBIS )
add_custom_target(check
COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIG> --output-on-failure
DEPENDS
test_sample_cache
test_sfont_loading
test_defsfont_preset_iteration
test_sample_rate_change
test_sf3_sfont_loading
test_sf3_defsfont_preset_iteration
)
else ( LIBSNDFILE_HASVORBIS )
add_custom_target(check
COMMAND ${CMAKE_CTEST_COMMAND} -C $<CONFIG> --output-on-failure
DEPENDS
test_sample_cache
test_sfont_loading
test_defsfont_preset_iteration
test_sample_rate_change
)
endif ( LIBSNDFILE_HASVORBIS )

0 comments on commit c433fc8

Please sign in to comment.