added first unit test

This commit is contained in:
bjt-user 2024-07-09 08:08:01 +02:00
parent ad344b03ac
commit c4fc332419
3 changed files with 22 additions and 0 deletions

10
unit-tests/README.md Normal file
View File

@ -0,0 +1,10 @@
For unit test `test_parse_ics.c`.
compilation command:
```
gcc -Wall test_parse_ics.c ../src/parse_ics.c ../src/string_handling.c ../src/list_handling.c ../src/date_time_handling.c ../src/read_until_string.c ../src/read_until_nl.c
```
```
./a.out
```

BIN
unit-tests/a.out Executable file

Binary file not shown.

View File

@ -0,0 +1,12 @@
#include "../src/list_handling.h"
#include "../src/parse_ics.h"
#include <stdio.h>
int main() {
// initialize empty list
struct event *head = NULL;
parse_ics_file("../tests/calendar.ics", &head);
print_list(head);
}