diff options
author | 2024-08-02 18:00:00 +0200 | |
---|---|---|
committer | 2024-08-02 18:00:00 +0200 | |
commit | 8acab012bff56dd8b538d60c76dc084637887895 (patch) | |
tree | c3f5007126bc3f86720be7101087340c559b9011 /test | |
parent | 7f2bb3643dd8781be4b5c1d3364f591e572c82e7 (diff) | |
download | properties-8acab012bff56dd8b538d60c76dc084637887895.tar.gz properties-8acab012bff56dd8b538d60c76dc084637887895.zip |
Add test directory
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile | 6 | ||||
-rw-r--r-- | test/main.c | 22 |
2 files changed, 28 insertions, 0 deletions
diff --git a/test/Makefile b/test/Makefile new file mode 100644 index 0000000..8215134 --- /dev/null +++ b/test/Makefile @@ -0,0 +1,6 @@ +test: + cc -c main.c -o main.o + cc main.o -L.. -l:libproperties.a -o $@ + +clean: + rm -rf test diff --git a/test/main.c b/test/main.c new file mode 100644 index 0000000..479c5fa --- /dev/null +++ b/test/main.c @@ -0,0 +1,22 @@ +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +void properties_load(FILE *file); + +int +main(int argc, char **argv) +{ + FILE *file; + + for (int i = 1; i < argc; i++) { + if (strcmp(argv[i], "-f") == 0 && (i + 1) < argc) { + file = fopen(argv[i + 1], "r"); + break; + } + } + + properties_load(file); + + return EXIT_SUCCESS; +} |