cmake: add COMMAND to velia_test
This patch allows to specify a custom COMMAND clause in velia_test call.
Currently velia_tests always calls the executable of the associated test
but sometimes we may want to wrap the command in another call (e.g.
unshare). This patch makes such calls easily possible.
Change-Id: I253e473ee1524f7b87561e7de7916eca5bc8858e
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c278a7b..b177e06 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -375,7 +375,11 @@
)
if(NOT CMAKE_CROSSCOMPILING)
- add_test(test-${TEST_NAME} test-${TEST_NAME})
+ if(NOT(TEST_COMMAND))
+ add_test(test-${TEST_NAME} test-${TEST_NAME})
+ else()
+ add_test(NAME test-${TEST_NAME} COMMAND ${TEST_COMMAND})
+ endif()
endif()
set(test_name_init sysrepo:prep:${TEST_NAME})