Add minunit test framework (#168)

* add minunit tests

* fix logging

* ignore unexisting time service on embedded targets

* fix warning, issue with printf

* add exitcode

* migrate to printf

* indicate test by leds

* add testing description

* redesigned minunit tests to allow testing in separate files

* add test step for local target

* add failure test

* add restore test_check

* testing description

Co-authored-by: rusdacent <rusdacentx0x08@gmail.com>
Co-authored-by: DrZlo13 <who.just.the.doctor@gmail.com>
This commit is contained in:
coreglitch
2020-10-10 16:32:06 +06:00
committed by GitHub
parent aa3ac5b242
commit 176e608c6d
18 changed files with 903 additions and 243 deletions

View File

@@ -23,26 +23,26 @@ void create_kill_app(void* p) {
}
}
bool test_furi_ac_create_kill(FuriRecordSubscriber* log) {
bool test_furi_ac_create_kill() {
uint8_t counter = 0;
uint8_t value_a = counter;
FuriApp* widget = furiac_start(create_kill_app, "create_kill_app", (void*)&counter);
if(widget == NULL) {
fuprintf(log, "create widget fail\n");
printf("create widget fail\n");
return false;
}
delay(10);
if(!furiac_kill(widget)) {
fuprintf(log, "kill widget fail\n");
printf("kill widget fail\n");
return false;
}
if(value_a == counter) {
fuprintf(log, "counter unchanged\n");
printf("counter unchanged\n");
return false;
}
@@ -51,7 +51,7 @@ bool test_furi_ac_create_kill(FuriRecordSubscriber* log) {
delay(10);
if(value_a != counter) {
fuprintf(log, "counter changes after kill (counter = %d vs %d)\n", value_a, counter);
printf("counter changes after kill (counter = %d vs %d)\n", value_a, counter);
return false;
}
@@ -111,7 +111,7 @@ void task_b(void* p) {
furiac_exit(p);
}
bool test_furi_ac_switch_exit(FuriRecordSubscriber* log) {
bool test_furi_ac_switch_exit() {
// init sequence
TestSwitchSequence seq;
seq.count = 0;
@@ -124,7 +124,7 @@ bool test_furi_ac_switch_exit(FuriRecordSubscriber* log) {
seq.sequence[seq.count] = '\0';
if(strcmp(seq.sequence, "ABA/") != 0) {
fuprintf(log, "wrong sequence: %s\n", seq.sequence);
printf("wrong sequence: %s\n", seq.sequence);
return false;
}