Improve test dependencies

The DEPENDS test property is a list, which can be appended to. What this
patch does is automatically append every datastore test to the
kill_daemons' DEPENDS property. This guarantees that daemons won't be
killed before datastore tests run. The Python test is changed in a
similar way.

Change-Id: I3e132c1b8cb7741cf225b2b4c4a8404d26a32b18
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6b7b3fb..79dd345 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -261,6 +261,8 @@
         datastore_test_impl(${name} ${CMAKE_CURRENT_SOURCE_DIR}/tests/example-schema.yang sysrepo)
         datastore_test_impl(${name} ${CMAKE_CURRENT_SOURCE_DIR}/tests/example-schema.yang netconf)
         set_tests_properties(${TESTNAME}_netconf_init PROPERTIES DEPENDS ${TESTNAME}_sysrepo_cleanup)
+        set_property(TEST kill_daemons APPEND PROPERTY DEPENDS ${TESTNAME}_sysrepo_cleanup)
+        set_property(TEST kill_daemons APPEND PROPERTY DEPENDS ${TESTNAME}_netconf_cleanup)
     endfunction()
 
     cli_test(cd)
@@ -280,9 +282,6 @@
 
     setup_datastore_tests()
     datastore_test(datastore_access ${CMAKE_CURRENT_SOURCE_DIR}/tests/example-schema.yang)
-    set_tests_properties(kill_daemons PROPERTIES DEPENDS test_datastore_access_netconf_cleanup)
-
-
 endif()
 
 option(WITH_PYTHON_BINDINGS "Create and install Python3 bindings for accessing datastores" OFF)
@@ -297,7 +296,7 @@
             ${CMAKE_CURRENT_BINARY_DIR}/tests_python_netconfaccess.py @ONLY)
         add_test(NAME test_netconf_cli_py COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/tests_python_netconfaccess.py)
         set_tests_properties(test_netconf_cli_py PROPERTIES FIXTURES_REQUIRED netopeer_running RESOURCE_LOCK sysrepo DEPENDS test_datastore_access_netconf_cleanup)
-        set_tests_properties(kill_daemons PROPERTIES DEPENDS test_netconf_cli_py)
+        set_property(TEST kill_daemons APPEND PROPERTY DEPENDS test_netconf_cli_py)
 
         set(sanitizer_active OFF)
         # FIXME: this just sucks. The detection is very unreliable (one could use something like