mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
**New features** - Created a devicetree DTS and YAML parser in Python - Created new modules: - TactilityKernel (LGPL v3.0 license) - Platforms/PlatformEsp32 (LGPL v3.0 license) - Platforms/PlatformPosix (LGPL v3.0 license) - Tests/TactilityKernelTests Most boards have a placeholder DTS file, while T-Lora Pager has a few devices attached. **Licenses** Clarified licenses and copyrights better. - Add explanation about the intent behind them. - Added explanation about licenses for past and future subprojects - Added more details explanations with regards to the logo usage - Copied licenses to subprojects to make it more explicit
58 lines
1.1 KiB
C++
58 lines
1.1 KiB
C++
#define DOCTEST_CONFIG_IMPLEMENT
|
|
#include "doctest.h"
|
|
#include <cassert>
|
|
|
|
#include <Tactility/FreeRTOS/task.h>
|
|
|
|
typedef struct {
|
|
int argc;
|
|
char** argv;
|
|
int result;
|
|
} TestTaskData;
|
|
|
|
void test_task(void* parameter) {
|
|
auto* data = (TestTaskData*)parameter;
|
|
|
|
doctest::Context context;
|
|
|
|
context.applyCommandLine(data->argc, data->argv);
|
|
|
|
// overrides
|
|
context.setOption("no-breaks", true); // don't break in the debugger when assertions fail
|
|
|
|
data->result = context.run();
|
|
|
|
vTaskEndScheduler();
|
|
|
|
vTaskDelete(nullptr);
|
|
}
|
|
|
|
int main(int argc, char** argv) {
|
|
TestTaskData data = {
|
|
.argc = argc,
|
|
.argv = argv,
|
|
.result = 0
|
|
};
|
|
|
|
BaseType_t task_result = xTaskCreate(
|
|
test_task,
|
|
"test_task",
|
|
8192,
|
|
&data,
|
|
1,
|
|
nullptr
|
|
);
|
|
assert(task_result == pdPASS);
|
|
|
|
vTaskStartScheduler();
|
|
|
|
return data.result;
|
|
}
|
|
|
|
extern "C" {
|
|
// Required for FreeRTOS
|
|
void vAssertCalled(unsigned long line, const char* const file) {
|
|
__assert_fail("assert failed", file, line, "");
|
|
}
|
|
}
|