From 65961695deccdff509e81a002276575d9d5066af Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 28 Feb 2022 20:35:05 +0100 Subject: [PATCH] small README --- unittest/rebootLogic/CMakeLists.txt | 13 +++---------- unittest/rebootLogic/README.md | 16 ++++++++++++++++ unittest/rebootLogic/src/CMakeLists.txt | 7 +++++++ .../rebootLogic/{ => src}/CoreController.cpp | 0 unittest/rebootLogic/{ => src}/CoreController.h | 0 unittest/rebootLogic/{ => src}/HasActionsIF.h | 0 unittest/rebootLogic/{ => src}/SdCardManager.cpp | 0 unittest/rebootLogic/{ => src}/SdCardManager.h | 0 unittest/rebootLogic/{ => src}/conf.h | 0 unittest/rebootLogic/{ => src}/definitions.h | 0 unittest/rebootLogic/{ => src}/event.cpp | 0 unittest/rebootLogic/{ => src}/event.h | 0 unittest/rebootLogic/{ => src}/libxiphos.cpp | 0 unittest/rebootLogic/{ => src}/libxiphos.h | 0 unittest/rebootLogic/{ => src}/main.cpp | 0 15 files changed, 26 insertions(+), 10 deletions(-) create mode 100644 unittest/rebootLogic/README.md create mode 100644 unittest/rebootLogic/src/CMakeLists.txt rename unittest/rebootLogic/{ => src}/CoreController.cpp (100%) rename unittest/rebootLogic/{ => src}/CoreController.h (100%) rename unittest/rebootLogic/{ => src}/HasActionsIF.h (100%) rename unittest/rebootLogic/{ => src}/SdCardManager.cpp (100%) rename unittest/rebootLogic/{ => src}/SdCardManager.h (100%) rename unittest/rebootLogic/{ => src}/conf.h (100%) rename unittest/rebootLogic/{ => src}/definitions.h (100%) rename unittest/rebootLogic/{ => src}/event.cpp (100%) rename unittest/rebootLogic/{ => src}/event.h (100%) rename unittest/rebootLogic/{ => src}/libxiphos.cpp (100%) rename unittest/rebootLogic/{ => src}/libxiphos.h (100%) rename unittest/rebootLogic/{ => src}/main.cpp (100%) diff --git a/unittest/rebootLogic/CMakeLists.txt b/unittest/rebootLogic/CMakeLists.txt index 9377d45e..dbaf2f28 100644 --- a/unittest/rebootLogic/CMakeLists.txt +++ b/unittest/rebootLogic/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0.0) +cmake_minimum_required(VERSION 3.13.0) project(reboot-logic VERSION 0.1.0) include(CTest) @@ -19,16 +19,9 @@ endif() enable_testing() -add_executable(reboot-logic main.cpp) - -target_sources(reboot-logic PRIVATE - main.cpp - CoreController.cpp - SdCardManager.cpp - event.cpp - libxiphos.cpp -) +add_executable(reboot-logic) +add_subdirectory(src) target_link_libraries(reboot-logic PRIVATE Catch2::Catch2WithMain) target_include_directories(reboot-logic PRIVATE diff --git a/unittest/rebootLogic/README.md b/unittest/rebootLogic/README.md new file mode 100644 index 00000000..a51f0745 --- /dev/null +++ b/unittest/rebootLogic/README.md @@ -0,0 +1,16 @@ +Reboot Logic Unittest +======= + +These tests were written with Catch2 and VS code. +Install VS code with the C++ and CMake plugins and open this folder with VS code. +You should be able to run the tests directly. + +It is also recommended to [install Catch2](https://github.com/catchorg/Catch2/blob/devel/docs/cmake-integration.md): + +```sh +git clone https://github.com/catchorg/Catch2.git +cd Catch2 +git checkout v3.0.0-preview4 +cmake -Bbuild -H. -DBUILD_TESTING=OFF +sudo cmake --build build/ --target install +``` diff --git a/unittest/rebootLogic/src/CMakeLists.txt b/unittest/rebootLogic/src/CMakeLists.txt new file mode 100644 index 00000000..674c288a --- /dev/null +++ b/unittest/rebootLogic/src/CMakeLists.txt @@ -0,0 +1,7 @@ +target_sources(reboot-logic PRIVATE + main.cpp + CoreController.cpp + SdCardManager.cpp + event.cpp + libxiphos.cpp +) diff --git a/unittest/rebootLogic/CoreController.cpp b/unittest/rebootLogic/src/CoreController.cpp similarity index 100% rename from unittest/rebootLogic/CoreController.cpp rename to unittest/rebootLogic/src/CoreController.cpp diff --git a/unittest/rebootLogic/CoreController.h b/unittest/rebootLogic/src/CoreController.h similarity index 100% rename from unittest/rebootLogic/CoreController.h rename to unittest/rebootLogic/src/CoreController.h diff --git a/unittest/rebootLogic/HasActionsIF.h b/unittest/rebootLogic/src/HasActionsIF.h similarity index 100% rename from unittest/rebootLogic/HasActionsIF.h rename to unittest/rebootLogic/src/HasActionsIF.h diff --git a/unittest/rebootLogic/SdCardManager.cpp b/unittest/rebootLogic/src/SdCardManager.cpp similarity index 100% rename from unittest/rebootLogic/SdCardManager.cpp rename to unittest/rebootLogic/src/SdCardManager.cpp diff --git a/unittest/rebootLogic/SdCardManager.h b/unittest/rebootLogic/src/SdCardManager.h similarity index 100% rename from unittest/rebootLogic/SdCardManager.h rename to unittest/rebootLogic/src/SdCardManager.h diff --git a/unittest/rebootLogic/conf.h b/unittest/rebootLogic/src/conf.h similarity index 100% rename from unittest/rebootLogic/conf.h rename to unittest/rebootLogic/src/conf.h diff --git a/unittest/rebootLogic/definitions.h b/unittest/rebootLogic/src/definitions.h similarity index 100% rename from unittest/rebootLogic/definitions.h rename to unittest/rebootLogic/src/definitions.h diff --git a/unittest/rebootLogic/event.cpp b/unittest/rebootLogic/src/event.cpp similarity index 100% rename from unittest/rebootLogic/event.cpp rename to unittest/rebootLogic/src/event.cpp diff --git a/unittest/rebootLogic/event.h b/unittest/rebootLogic/src/event.h similarity index 100% rename from unittest/rebootLogic/event.h rename to unittest/rebootLogic/src/event.h diff --git a/unittest/rebootLogic/libxiphos.cpp b/unittest/rebootLogic/src/libxiphos.cpp similarity index 100% rename from unittest/rebootLogic/libxiphos.cpp rename to unittest/rebootLogic/src/libxiphos.cpp diff --git a/unittest/rebootLogic/libxiphos.h b/unittest/rebootLogic/src/libxiphos.h similarity index 100% rename from unittest/rebootLogic/libxiphos.h rename to unittest/rebootLogic/src/libxiphos.h diff --git a/unittest/rebootLogic/main.cpp b/unittest/rebootLogic/src/main.cpp similarity index 100% rename from unittest/rebootLogic/main.cpp rename to unittest/rebootLogic/src/main.cpp