I have some test added by command add_test
:
find_program(PYTEST "pytest")
add_test(NAME test_something COMMAND ${PYTEST})
But before this test I need to copy some test files (including python test scripts to be run). For this purpose there is a custom target generate_init_queries
. Since add_test
doesn't create a target I can't use add_dependencies
to link my custom target generate_init_queries
and this test. I supposed that there should exist a test
target in CMake and added the command:
add_dependencies(test generate_init_queries)
But it resulted in error annot add target-level dependencies to non-existent target "test"
. How can I copy files before running the test in make test
?