EflMacros: build tests before running them.

'make test' wouldn't build the test, which is annoying.

There is no way to add dependencies to reserved target 'test'. The
test is also executed by another tool (ctest), not cmake itself, then
we must create a test '-build' that is actually calling back cmake to
compile the test suite and make it a dependency for the test itself.

Nasty but improves usability.
This commit is contained in:
Gustavo Sverzut Barbieri 2017-01-23 14:02:08 -02:00 committed by Marcel Hollerbach
parent f009bc8b2b
commit b10fc88bb0
1 changed files with 3 additions and 0 deletions

View File

@ -766,6 +766,9 @@ function(EFL_TEST _testname)
add_test(NAME ${_testname} COMMAND ${_testtarget})
LIST_APPEND_GLOBAL(${EFL_LIB_CURRENT}_TESTS ${_testtarget})
add_test(${_testname}-build "${CMAKE_COMMAND}" --build ${CMAKE_BINARY_DIR} --target ${_testtarget})
set_tests_properties(${_testname} PROPERTIES DEPENDS ${_testname}-build)
endfunction()
# EFL_MODULE(Name)