dune_add_test: allow target name and target file to be different
Merge request reports
Activity
OK, I'm guessing the original stuff does not work on windows because the ctest looks for a file named
TEST
, but in fact the file is namedTEST.exe
? Or what exactly is the problemwiththis MR solves?Edited by Jö FahlkeLet's say I add a target
${TARGET}
compiled from a file${NAME}.cc
and I'd like the executable to be${NAME}
:add_executable(${TARGET} ${NAME}.cc ...) set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME ${NAME}) dune_add_test(NAME ${TEST} TARGET ${TARGET} COMMAND ${TARGET})
Then it won't run the test, since it adds
${TARGET}
as a required file instead of${NAME}
. Note that the propertyCOMMAND
actually doesn't change anything here.I structure my tests in folders such as
/test/cat/subcat/subsubcat
matching the project structure/cat/subcat/subsubcat
. A testcase gets created under the targettest-cat-subcat-subsubcat-testcase
since it needs to be unique, but I'd like to have the executable file read/test/cat/subcat/subsubcat/testcase
instead of/test/cat/subcat/subsubcat/test-cat-subcat-subsubcat-testcase
which is currently mandatory indune_add_test()
.mentioned in commit 51b12f19