mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-20 22:55:00 +08:00
Merge branch 'feature/doctest' into feature/CAN
This commit is contained in:
+2
-1
@@ -18,7 +18,8 @@
|
||||
"${workspaceRoot}/Board/v3/Middlewares/ST/STM32_USB_Device_Library/Class/CDC/Inc",
|
||||
"${workspaceRoot}/Board/v3/Middlewares/Third_Party/FreeRTOS/Source/CMSIS_RTOS",
|
||||
"${workspaceRoot}/Board/v3/Middlewares/Third_Party/FreeRTOS/Source/include",
|
||||
"${workspaceRoot}/Board/v3/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F"
|
||||
"${workspaceRoot}/Board/v3/Middlewares/Third_Party/FreeRTOS/Source/portable/GCC/ARM_CM4F",
|
||||
"C:/Tools/doctest/doctest"
|
||||
],
|
||||
"defines": [
|
||||
"STM32F405xx",
|
||||
|
||||
@@ -106,6 +106,7 @@ void enter_dfu_mode() {
|
||||
|
||||
extern "C" {
|
||||
int odrive_main(void);
|
||||
|
||||
void vApplicationStackOverflowHook(xTaskHandle *pxTask, signed portCHAR *pcTaskName) {
|
||||
for (;;); // TODO: safe action
|
||||
}
|
||||
@@ -125,8 +126,16 @@ void vApplicationIdleHook(void) {
|
||||
}
|
||||
}
|
||||
|
||||
#include <doctest.h>
|
||||
int odrive_main(void) {
|
||||
|
||||
doctest::Context context;
|
||||
|
||||
auto vals = context.run();
|
||||
while(vals){
|
||||
|
||||
}
|
||||
|
||||
#if HW_VERSION_MAJOR == 3 && HW_VERSION_MINOR >= 3
|
||||
if (board_config.enable_i2c_instead_of_can) {
|
||||
// Set up the direction GPIO as input
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
|
||||
#define DOCTEST_CONFIG_IMPLEMENT
|
||||
#define DOCTEST_CONFIG_TREAT_CHAR_STAR_AS_STRING
|
||||
#define DOCTEST_CONFIG_USE_STD_HEADERS
|
||||
#define DOCTEST_CONFIG_NO_TRY_CATCH_IN_ASSERTS
|
||||
#define DOCTEST_CONFIG_NO_EXCEPTIONS
|
||||
#define DOCTEST_CONFIG_NO_WINDOWS_SEH
|
||||
#define DOCTEST_CONFIG_NO_POSIX_SIGNALS
|
||||
// #define DOCTEST_CONFIG_VOID_CAST_EXPRESSIONS
|
||||
|
||||
#include <doctest.h>
|
||||
|
||||
#include "odrive_main.h"
|
||||
|
||||
TEST_CASE("[something]"){
|
||||
CHECK(mod(3, 10) == 3);
|
||||
}
|
||||
@@ -177,12 +177,14 @@ build{
|
||||
'communication/interface_can.cpp',
|
||||
'communication/interface_i2c.cpp',
|
||||
'fibre/cpp/protocol.cpp',
|
||||
'FreeRTOS-openocd.c'
|
||||
'FreeRTOS-openocd.c',
|
||||
'Tests/test_runner.cpp'
|
||||
},
|
||||
includes={
|
||||
'Drivers/DRV8301',
|
||||
'MotorControl',
|
||||
'fibre/cpp/include',
|
||||
'.'
|
||||
'.',
|
||||
"C:/Tools/doctest/doctest"
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user