Branching from Cathaswatch project
https://git.nerdyssey.de/exodus/1NiM-WatingRoom-WatchController
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
# This is the project CMakeLists.txt file for the test subproject
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
|
||||
# Include the components directory of the main application:
|
||||
#
|
||||
set(EXTRA_COMPONENT_DIRS
|
||||
"../../components"
|
||||
"../../core/components"
|
||||
"../../core/managed_components"
|
||||
)
|
||||
|
||||
# Set the components to include the tests for.
|
||||
# This can be overriden from CMake cache:
|
||||
# - when invoking CMake directly: cmake -D TEST_COMPONENTS="xxxxx" ..
|
||||
# - when using idf.py: idf.py -T xxxxx build
|
||||
#
|
||||
set(TEST_COMPONENTS "testable freeRtosApi hwHal spit" CACHE STRING "List of components to test" FORCE)
|
||||
|
||||
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
|
||||
project(unit_test)
|
||||
@@ -0,0 +1,3 @@
|
||||
# Unit Testing
|
||||
|
||||
see Redme in `Project/core/test/unitOnTarget/ReadMe.md`
|
||||
@@ -0,0 +1,10 @@
|
||||
dependencies:
|
||||
idf:
|
||||
source:
|
||||
type: idf
|
||||
version: 5.4.1
|
||||
direct_dependencies:
|
||||
- idf
|
||||
manifest_hash: 00d8efc8e59d9f2cc6a576ada310175e19e6f7506dd0b59211849f065dadccae
|
||||
target: esp32c6
|
||||
version: 2.0.0
|
||||
@@ -0,0 +1,4 @@
|
||||
idf_component_register(
|
||||
SRCS "unitTest.cpp"
|
||||
INCLUDE_DIRS "."
|
||||
)
|
||||
@@ -0,0 +1,7 @@
|
||||
# Run Exportport Script first
|
||||
|
||||
build:
|
||||
idf.py build
|
||||
|
||||
run:
|
||||
idf.py -p /dev/ttyUSB0 flash monitor
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* @file unitTest.cpp
|
||||
* @author Gustice
|
||||
* @brief Unit/Integration-Test frame for hardware bound components
|
||||
*
|
||||
* @copyright Copyright (c) 2024
|
||||
*/
|
||||
|
||||
#include "unity.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/task.h"
|
||||
|
||||
extern "C" { // This switch allows the ROS C-implementation to find this main
|
||||
void app_main(void);
|
||||
}
|
||||
|
||||
void app_main(void) {
|
||||
printf("\n#### Running all the registered tests #####\n\n");
|
||||
UNITY_BEGIN();
|
||||
unity_run_all_tests();
|
||||
// Alternatively:
|
||||
// "Executing one test by its name"
|
||||
// unity_run_test_by_name("Mean of an empty array is zero");
|
||||
// Running tests with [mean] tag"
|
||||
// unity_run_tests_by_tag("[mean]", false);
|
||||
// print_banner("Running tests without [fails] tag");
|
||||
// unity_run_tests_by_tag("[fails]", true);
|
||||
UNITY_END();
|
||||
|
||||
printf("\n#### Starting interactive test menu: ####\n");
|
||||
printf("# - run explicit #\n");
|
||||
printf("- run all with *, \n");
|
||||
printf("# - run tagged with [tag], \n");
|
||||
printf("# - run all other than ![tag])\n");
|
||||
printf("# Exit with 'Ctrl-]'\n");
|
||||
// unity_run_menu(); // Watchdog needs to
|
||||
|
||||
while (true) {
|
||||
vTaskDelay(10);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
CONFIG_COMPILER_CXX_EXCEPTIONS=y
|
||||
|
||||
CONFIG_ESP_TASK_WDT_EN=n
|
||||
Reference in New Issue
Block a user