Delete unnecessary test-dbus and update spec file to install tc.
Signed-off-by: Jaeyun Jung <jy1210.jung@samsung.com>
%{_bindir}/unittest-ml
%{_libdir}/libml-agent-test.a
%{_libdir}/libml-agent-test.so*
-%{_libdir}/libunittest_mock.so*
%if 0%{?gcov:1}
%{_bindir}/tizen-unittests/%{name}/run-unittest.sh
%endif
unittest_gdbus_util = executable('unittest_gdbus_util',
'unittest_gdbus_util.cc',
- dependencies: [gtest_dep, ml_agent_test_dep, gdbus_gen_test_dep],
+ dependencies: [gtest_dep, ml_agent_test_dep],
link_with: ml_agent_lib,
install: get_option('install-test'),
install_dir: unittest_install_dir,
#include <gtest/gtest.h>
-#include "../dbus/test-dbus-interface.h"
#include "dbus-interface.h"
#include "gdbus-util.h"
#include "log.h"
-#include "test-dbus.h"
/**
* @brief Test base class for GDbus.
}
};
-/**
- * @brief Call the 'get_state' DBus method and check the result.
- */
-TEST_F (GDbusTest, call_method)
-{
- MachinelearningServiceTest *proxy = NULL;
- GError *error = NULL;
- int status = 0;
- int result = 0;
-
- /* Test : Connect to the DBus interface */
- proxy = machinelearning_service_test_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
- G_DBUS_PROXY_FLAGS_NONE, DBUS_ML_BUS_NAME, DBUS_TEST_PATH, NULL, &error);
- if (error != NULL) {
- g_error_free (error);
- FAIL ();
- }
-
- /* Test: Call the DBus method */
- machinelearning_service_test_call_get_state_sync (proxy, &status, &result, NULL, &error);
- if (error != NULL) {
- ml_loge ("Error : %s", error->message);
- g_error_free (error);
- FAIL ();
- }
-
- /* Check the return value */
- EXPECT_EQ (result, 0);
- EXPECT_EQ (status, 1);
-
- g_object_unref (proxy);
-}
-
/**
* @brief Negative test for the gdbus helper function, gdbus_export_interface().
*/
+++ /dev/null
-test_dbus_impl_srcs = files('test-dbus-impl.c')
-test_dbus_input = files('test-dbus.xml')
-
-gdbus_gen_test_src = custom_target('gdbus-gencode-test',
- input: test_dbus_input,
- output: ['test-dbus.h', 'test-dbus.c'],
- command: [gdbus_prog, '--interface-prefix', 'org.tizen',
- '--generate-c-code', 'test-dbus',
- '--output-directory', meson.current_build_dir(),
- '@INPUT@'])
-
-gdbus_gen_test_dep = declare_dependency(sources: gdbus_gen_test_src,
- dependencies: gdbus_gen_header_dep)
+++ /dev/null
-/* SPDX-License-Identifier: Apache-2.0 */
-/**
- * Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
- *
- * @file test-dbus-impl.c
- * @date 16 Jul 2022
- * @brief DBus implementation for test interface
- * @see https://github.com/nnstreamer/deviceMLOps.MLAgent
- * @author Sangjung Woo <sangjung.woo@samsung.com>
- * @bug No known bugs except for NYI items
- */
-
-#include <glib.h>
-#include <stdbool.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include <common.h>
-#include <modules.h>
-#include <gdbus-util.h>
-#include <log.h>
-
-#include "test-dbus-interface.h"
-#include "test-dbus.h"
-
-static MachinelearningServiceTest *g_gdbus_instance = NULL;
-
-/**
- * @brief DBus handler for 'get_state' method of test interface.
- */
-static gboolean
-dbus_cb_service_get_status (MachinelearningServiceTest * obj,
- GDBusMethodInvocation * invoc)
-{
- int ret = 0;
- int status = 1;
-
- machinelearning_service_test_complete_get_state (obj, invoc, status, ret);
- return TRUE;
-}
-
-static struct gdbus_signal_info g_gdbus_signal_infos[] = {
- {
- .signal_name = DBUS_TEST_I_GET_STATE_HANDLER,
- .cb = G_CALLBACK (dbus_cb_service_get_status),
- .cb_data = NULL,
- .handler_id = 0,
- },
-};
-
-/**
- * @brief Utility function to get the DBus proxy of test interface.
- */
-static MachinelearningServiceTest *
-gdbus_get_instance_test (void)
-{
- return machinelearning_service_test_skeleton_new ();
-}
-
-/**
- * @brief Utility function to release DBus proxy.
- */
-static void
-gdbus_put_instance_test (MachinelearningServiceTest ** instance)
-{
- g_clear_object (instance);
-}
-
-/**
- * @brief The callback function for initializing test module.
- */
-static void
-init_test (void *data)
-{
- ml_logd ("init_test module");
-
- gdbus_initialize ();
-}
-
-/**
- * @brief The callback function for exiting test module.
- */
-static void
-exit_test (void *data)
-{
- gdbus_disconnect_signal (g_gdbus_instance,
- ARRAY_SIZE (g_gdbus_signal_infos), g_gdbus_signal_infos);
- gdbus_put_instance_test (&g_gdbus_instance);
-}
-
-/**
- * @brief The callback function for proving test module.
- */
-static int
-probe_test (void *data)
-{
- int ret = 0;
-
- ml_logd ("probe_test");
-
- g_gdbus_instance = gdbus_get_instance_test ();
- if (g_gdbus_instance == NULL) {
- ml_loge ("Cannot get the dbus instance for the %s interface.",
- DBUS_TEST_INTERFACE);
- return -ENOSYS;
- }
-
- ret = gdbus_connect_signal (g_gdbus_instance,
- ARRAY_SIZE (g_gdbus_signal_infos), g_gdbus_signal_infos);
- if (ret < 0) {
- ml_loge ("Cannot register callbacks as the dbus method invocation handlers (ret: %d).",
- ret);
- ret = -ENOSYS;
- goto out;
- }
-
- ret = gdbus_export_interface (g_gdbus_instance, DBUS_TEST_PATH);
- if (ret < 0) {
- ml_loge ("Cannot export the dbus interface '%s' at the object path '%s'.",
- DBUS_TEST_INTERFACE, DBUS_TEST_PATH);
- ret = -ENOSYS;
- goto out_disconnect;
- }
- return 0;
-
-out_disconnect:
- gdbus_disconnect_signal (g_gdbus_instance,
- ARRAY_SIZE (g_gdbus_signal_infos), g_gdbus_signal_infos);
-out:
- gdbus_put_instance_test (&g_gdbus_instance);
-
- return ret;
-}
-
-static const struct module_ops test_ops = {
- .name = "ml-agent-test",
- .probe = probe_test,
- .init = init_test,
- .exit = exit_test,
-};
-
-MODULE_OPS_REGISTER (&test_ops)
+++ /dev/null
-/* SPDX-License-Identifier: Apache-2.0 */
-/**
- * NNStreamer API / Machine Learning Agent Daemon
- * Copyright (C) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
- */
-
-/**
- * @file test-dbus-interface.h
- * @date 16 Jul 2022
- * @brief Test header for the definition of DBus node and interfaces.
- * @see https://github.com/nnstreamer/deviceMLOps.MLAgent
- * @author Sangjung Woo <sangjung.woo@samsung.com>
- * @bug No known bugs except for NYI items
- *
- * @details
- * This defines the machine learning agent's bus, interface, and method names for test.
- */
-
-#ifndef __TEST_DBUS_INTERFACE_H__
-#define __TEST_DBUS_INTERFACE_H__
-
-#define DBUS_TEST_INTERFACE "org.tizen.machinelearning.service.test"
-#define DBUS_TEST_PATH "/Org/Tizen/MachineLearning/Service/Test"
-
-#define DBUS_TEST_I_GET_STATE_HANDLER "handle-get-state"
-
-#endif /* __TEST_DBUS_INTERFACE_H__ */
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" ?>
-<node name="/Org/Tizen/MachineLearning/Service">
- <interface name="org.tizen.machinelearning.service.test">
- <method name="get_state">
- <arg type="i" name="state" direction="out" />
- <arg type="i" name="result" direction="out" />
- </method>
- </interface>
-</node>
link_with: ml_agent_test_lib
)
-subdir('dbus')
-
ml_agent_main_objs = ml_agent_executable.extract_objects(ml_agent_main_file)
executable('machine-learning-agent-test',
- test_dbus_impl_srcs,
- dependencies: [ml_agent_test_dep, gdbus_gen_test_dep],
+ dependencies: ml_agent_test_dep,
install: get_option('install-test'),
install_dir: unittest_base_dir,
objects: ml_agent_main_objs