--- /dev/null
+########################## search for packages ################################
+
+SET(TARGET_UWB_HALTESTS "uwb-haltests")
+
+PKG_CHECK_MODULES(TARGET_UWB_HALTESTS_REQ_PKGS REQUIRED ${GTEST_DEPS} ${COMMON_DEPS} gmock)
+
+############################# compiler flags ##################################
+
+SET(EXTRA_FLAGS "-Wall -Werror")
+SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${EXTRA_FLAGS} ${CFLAGS}")
+SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_FLAGS} -std=c++11")
+SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -pie")
+
+######################## directory configuration ############################
+
+INCLUDE_DIRECTORIES(${TARGET_UWB_HALTESTS_REQ_PKGS_INCLUDE_DIRS})
+LINK_DIRECTORIES(${TARGET_UWB_HALTESTS_REQ_PKGS_LIBRARY_DIRS})
+
+INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/interface)
+INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include)
+
+FILE(GLOB GTEST_SRCS
+ *.cpp
+ ${CMAKE_SOURCE_DIR}/src/UwbHal.cpp)
+LIST(REMOVE_ITEM GTEST_SRCS ${CMAKE_SOURCE_DIR}/src/main.cpp)
+SET(GTEST_SRCS ${GTEST_SRCS} ${CMAKE_SOURCE_DIR}/interface/generated-code.c)
+SET_SOURCE_FILES_PROPERTIES(${CMAKE_SOURCE_DIR}/interface/generated-code.c PROPERTIES GENERATED TRUE)
+
+# Build
+ADD_EXECUTABLE(${TARGET_UWB_HALTESTS} ${GTEST_SRCS})
+ADD_DEPENDENCIES(${TARGET_UWB_HALTESTS} GENERATED_DBUS_CODE)
+
+MESSAGE("${TARGET_UWB_HALTESTS_REQ_PKGS_LIBRARIES}")
+TARGET_LINK_LIBRARIES(${TARGET_UWB_HALTESTS}
+ ${TARGET_UWB_HALTESTS_REQ_PKGS_LIBRARIES} -ldl -lpaho-mqtt3a -lpthread)
+
+SET_TARGET_PROPERTIES(${TARGET_UWB_HALTESTS} PROPERTIES
+ COMPILE_FLAGS "-fPIE")
+
+INSTALL(TARGETS ${TARGET_UWB_HALTESTS} DESTINATION ${BIN_DIR}/hal)
--- /dev/null
+/*
+ * uwb-manager-gtest.cpp
+ *
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Contact: Jihoon Jung <jh8801.jung@samsung.com>, Jiung Yu <jiung.yu@samsung.com>
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/*****************************************************************************
+ * Standard headers
+ *****************************************************************************/
+#include <stdio.h>
+#include <memory>
+
+/*****************************************************************************
+ * System headers
+ *****************************************************************************/
+#include <gtest/gtest.h>
+
+/*****************************************************************************
+ * Local headers
+ *****************************************************************************/
+#include <UwbHal.h>
+
+/*****************************************************************************
+ * Macros and Typedefs
+ *****************************************************************************/
+/*****************************************************************************
+ * Global Variables
+ *****************************************************************************/
+/*****************************************************************************
+ * Local Functions Definition
+ *****************************************************************************/
+
+class UwbHalTest : public ::testing::Test {
+
+protected:
+ void SetUp() override
+ {
+ this->_uwb_hal = std::make_shared<UwbManagerNamespace::UwbHal>();
+ this->_uwb_hal->init();
+ this->_uwb_hal->enableNetwork();
+ }
+
+ void TearDown() override
+ {
+ this->_uwb_hal->disableNetwork();
+ this->_uwb_hal->deinit();
+ }
+
+ std::shared_ptr<UwbManagerNamespace::UwbHal> _uwb_hal;
+ int ret;
+};
+
+TEST_F(UwbHalTest, uwb_hal_start)
+{
+ ret = _uwb_hal->start();
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+TEST_F(UwbHalTest, uwb_hal_stop)
+{
+ ret = _uwb_hal->stop();
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+TEST_F(UwbHalTest, uwb_hal_test)
+{
+ ret = _uwb_hal->test();
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+TEST_F(UwbHalTest, uwb_hal_reset)
+{
+ ret = _uwb_hal->reset();
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+TEST_F(UwbHalTest, uwb_hal_factory_reset)
+{
+ ret = _uwb_hal->factoryReset();
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+TEST_F(UwbHalTest, uwb_hal_enable_network)
+{
+ _uwb_hal->disableNetwork();
+
+ ret = _uwb_hal->enableNetwork();
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+TEST_F(UwbHalTest, uwb_hal_disable_network)
+{
+ ret = _uwb_hal->disableNetwork();
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+TEST_F(UwbHalTest, uwb_hal_get_own_node)
+{
+ uwb_node_s *own_node = NULL;
+
+ ret = _uwb_hal->getOwnNode(&own_node);
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+TEST_F(UwbHalTest, uwb_hal_get_network_info)
+{
+ uwb_network_s *network_info;
+
+ ret = _uwb_hal->getNetworkInfo(&network_info);
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+TEST_F(UwbHalTest, uwb_hal_set_configurations)
+{
+ GVariant *configurations = NULL;
+ GVariantBuilder *builder;
+ int ret = 0;
+
+ _uwb_hal->disableNetwork();
+
+ builder = g_variant_builder_new(G_VARIANT_TYPE("a{sv}"));
+
+ configurations = g_variant_new("a{sv}", builder);
+
+ ret = _uwb_hal->setConfigurations(0, configurations);
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+TEST_F(UwbHalTest, uwb_hal_get_configurations)
+{
+ GVariant *configurations;
+
+ ret = _uwb_hal->getConfigurations(0, &configurations);
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+TEST_F(UwbHalTest, uwb_hal_send_message)
+{
+ ret = _uwb_hal->sendMessage((const unsigned char *)"HELLO", 5);
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+TEST_F(UwbHalTest, uwb_hal_send_message_to)
+{
+ ret = _uwb_hal->sendMessageTo(0, (const unsigned char *)"HELLO", 5);
+
+ if (ret == -ENOTSUP)
+ ASSERT_TRUE(true);
+ else
+ ASSERT_EQ(0, ret);
+}
+
+int main(int argc, char **argv)
+{
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+}