Add unit test example

This commit is contained in:
Niccolò Izzo 2021-11-02 19:42:16 +01:00
parent 83fdfc4367
commit 5040d6e900
2 changed files with 18 additions and 0 deletions

View File

@ -512,3 +512,10 @@ foreach t : targets
endif endif
endforeach endforeach
##
## ----------------------------------- Unit Tests ------------------------------
##
dummy_test = executable('dummy', 'tests/unit/dummy.c')
test('Dummy Unit Test', dummy_test)

11
tests/unit/dummy.c Normal file
View File

@ -0,0 +1,11 @@
#include <stdio.h>
int main() {
if (1) {
printf("PASS!\n");
return 0;
} else {
printf("FAIL!\n");
return -1;
}
}