ml_agentd_lib_service_db_srcs,
dependencies: ml_agentd_deps,
include_directories: ml_agentd_incs,
- install: false,
+ install: get_option('install-test'),
+ install_dir: api_install_libdir,
cpp_args: ['-DDB_PATH="."', daemon_cpp_db_key_prefix_arg],
objects: ml_agentd_lib_common_objs,
version: api_version,
%files -n capi-machine-learning-unittests
%manifest capi-machine-learning-inference.manifest
%{_bindir}/unittest-ml
+%{_libdir}/libml-agentd-test.a
+%{_libdir}/libml-agentd-test.so*
+%{_libdir}/libunittest_mock.so*
%if 0%{?gcov:1}
%{_bindir}/tizen-unittests/%{name}/run-unittest.sh
%endif
*/
#include <gtest/gtest.h>
+#include <gdbus-util.h>
#include <gio/gio.h>
#include <ml-api-inference-pipeline-internal.h>
#include <ml-api-internal.h>
{
int status;
+ /**
+ * FIXME: The following line blocks this test from running
+ * with the ml-agent daemon, not the test daemon.
+ */
+ if (!gdbus_get_system_connection (false)) {
+ return;
+ }
+
status = ml_service_set_pipeline ("test", "test");
EXPECT_EQ (ML_ERROR_IO_ERROR, status);
const gchar *root_path = g_getenv ("MLAPI_SOURCE_ROOT_PATH");
unsigned int version;
+ /**
+ * FIXME: The following line blocks this test from running
+ * with the ml-agent daemon, not the test daemon.
+ */
+ if (!gdbus_get_system_connection (false)) {
+ return;
+ }
+
/* ml_service_model_register() requires absolute path to model, ignore this case. */
if (root_path == NULL)
return;
gboolean is_session = true;
int ret;
+ /**
+ * FIXME: The following line blocks this test from running
+ * with the ml-agent daemon, not the test daemon.
+ */
+ if (!gdbus_get_system_connection (!is_session)) {
+ return;
+ }
ret = gdbus_get_system_connection (is_session);
EXPECT_EQ (-ENOSYS, ret);
executable('machine-learning-agent-test',
test_dbus_impl_srcs,
dependencies: [lib_ml_agentd_test_dep, gdbus_gen_test_dep],
+ install: get_option('install-test'),
+ install_dir: unittest_base_dir,
link_with: lib_unittest_mock,
objects: ml_agentd_main_objs,
)
lib_unittest_mock = shared_library('unittest_mock',
files('mock_package_manager.c'),
dependencies: glib_dep,
+ install: get_option('install-test'),
+ install_dir: api_install_libdir,
include_directories: nns_capi_include
)
output: test_dbus_service_file,
configuration: builddir_cdata
)
+
+if get_option('install-test')
+ installed_builddir_cdata = configuration_data()
+ installed_builddir_cdata.set('build_dir', unittest_base_dir)
+ test_service_file = configure_file(
+ input: test_dbus_service_file + '.in',
+ output: test_dbus_service_file + '.install',
+ configuration: installed_builddir_cdata
+ )
+ install_data(
+ test_service_file,
+ install_dir: join_paths(unittest_install_dir, 'services'),
+ install_mode: 'rw-r--r--',
+ rename: test_dbus_service_file,
+ )
+endif