From b872fd7d0b500a5c8947eacb178ae801295cab6a Mon Sep 17 00:00:00 2001 From: Yann Locatelli Date: Wed, 13 Dec 2023 17:10:12 +0100 Subject: [PATCH] :sparkles: (BehaviorKit): Create new BehaviorKit --- libs/BehaviorKit/CMakeLists.txt | 24 +++++++++++++++++++ libs/BehaviorKit/include/BehaviorKit.h | 17 ++++++++++++++ libs/BehaviorKit/source/BehaviorKit.cpp | 7 ++++++ libs/BehaviorKit/tests/BehaviorKit_test.cpp | 26 +++++++++++++++++++++ libs/CMakeLists.txt | 1 + spikes/lk_behavior_kit/CMakeLists.txt | 1 + tests/unit/CMakeLists.txt | 1 + 7 files changed, 77 insertions(+) create mode 100644 libs/BehaviorKit/CMakeLists.txt create mode 100644 libs/BehaviorKit/include/BehaviorKit.h create mode 100644 libs/BehaviorKit/source/BehaviorKit.cpp create mode 100644 libs/BehaviorKit/tests/BehaviorKit_test.cpp diff --git a/libs/BehaviorKit/CMakeLists.txt b/libs/BehaviorKit/CMakeLists.txt new file mode 100644 index 0000000000..73c3901a1b --- /dev/null +++ b/libs/BehaviorKit/CMakeLists.txt @@ -0,0 +1,24 @@ +# Leka - LekaOS +# Copyright 2023 APF France handicap +# SPDX-License-Identifier: Apache-2.0 + +add_library(BehaviorKit STATIC) + +target_include_directories(BehaviorKit + PUBLIC + include +) + +target_sources(BehaviorKit + PRIVATE + source/BehaviorKit.cpp +) + +target_link_libraries(BehaviorKit +) + +if(${CMAKE_PROJECT_NAME} STREQUAL "LekaOSUnitTests") + leka_unit_tests_sources( + tests/BehaviorKit_test.cpp + ) +endif() diff --git a/libs/BehaviorKit/include/BehaviorKit.h b/libs/BehaviorKit/include/BehaviorKit.h new file mode 100644 index 0000000000..76f563e4f1 --- /dev/null +++ b/libs/BehaviorKit/include/BehaviorKit.h @@ -0,0 +1,17 @@ +// Leka - LekaOS +// Copyright 2023 APF France handicap +// SPDX-License-Identifier: Apache-2.0 + +#pragma once + +namespace leka { + +class BehaviorKit +{ + public: + explicit BehaviorKit() = default; + + private: +}; + +} // namespace leka diff --git a/libs/BehaviorKit/source/BehaviorKit.cpp b/libs/BehaviorKit/source/BehaviorKit.cpp new file mode 100644 index 0000000000..80ba6d3d1f --- /dev/null +++ b/libs/BehaviorKit/source/BehaviorKit.cpp @@ -0,0 +1,7 @@ +// Leka - LekaOS +// Copyright 2023 APF France handicap +// SPDX-License-Identifier: Apache-2.0 + +#include "BehaviorKit.h" + +using namespace leka; diff --git a/libs/BehaviorKit/tests/BehaviorKit_test.cpp b/libs/BehaviorKit/tests/BehaviorKit_test.cpp new file mode 100644 index 0000000000..84e497d153 --- /dev/null +++ b/libs/BehaviorKit/tests/BehaviorKit_test.cpp @@ -0,0 +1,26 @@ +// Leka - LekaOS +// Copyright 2023 APF France handicap +// SPDX-License-Identifier: Apache-2.0 + +#include "BehaviorKit.h" + +#include "gmock/gmock.h" +#include "gtest/gtest.h" + +using namespace leka; + +class BehaviorKitTest : public ::testing::Test +{ + protected: + BehaviorKitTest() : behaviorkit() {}; + + // void SetUp() override {} + // void TearDown() override {} + + BehaviorKit behaviorkit; +}; + +TEST_F(BehaviorKitTest, initialization) +{ + ASSERT_NE(&behaviorkit, nullptr); +} diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index c70dc14560..734c63fa87 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -4,6 +4,7 @@ add_subdirectory(${LIBS_DIR}/ActivityKit) add_subdirectory(${LIBS_DIR}/BatteryKit) +add_subdirectory(${LIBS_DIR}/BehaviorKit) add_subdirectory(${LIBS_DIR}/BehaviorKitDeprecated) add_subdirectory(${LIBS_DIR}/BLEKit) add_subdirectory(${LIBS_DIR}/ColorKit) diff --git a/spikes/lk_behavior_kit/CMakeLists.txt b/spikes/lk_behavior_kit/CMakeLists.txt index b5e0ae0976..ab3c1e8b55 100644 --- a/spikes/lk_behavior_kit/CMakeLists.txt +++ b/spikes/lk_behavior_kit/CMakeLists.txt @@ -15,6 +15,7 @@ target_sources(spike_lk_behavior_kit ) target_link_libraries(spike_lk_behavior_kit + BehaviorKit BehaviorKitDeprecated CorePwm EventLoopKit diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index d5af3a081d..674dce1eeb 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -281,6 +281,7 @@ leka_register_unit_tests_for_driver(CoreVideo) # Register libraries leka_register_unit_tests_for_library(ActivityKit) leka_register_unit_tests_for_library(BatteryKit) +leka_register_unit_tests_for_library(BehaviorKit) leka_register_unit_tests_for_library(BehaviorKitDeprecated) leka_register_unit_tests_for_library(BLEKit) leka_register_unit_tests_for_library(ColorKit)