From 0aaf6a24c91250fce676dbe6e890aed0639ee772 Mon Sep 17 00:00:00 2001 From: Marcel Date: Sat, 22 Feb 2014 20:47:27 +0000 Subject: [PATCH] Added tests to makefile. --- c/Makefile | 13 +++++++++++-- c/tests.c | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/c/Makefile b/c/Makefile index fd5854f..aedf1d8 100644 --- a/c/Makefile +++ b/c/Makefile @@ -1,6 +1,6 @@ -all: build static-lib dynamic-lib example +all: build static-lib dynamic-lib example compile-tests build: gcc -c -g cmdlineoptions.c @@ -20,4 +20,13 @@ clean: example: gcc -I. -g example.c -o example-shared -L. -lcmdlineoptions - gcc -g example.c -o example-static libcmdlineoptions.a \ No newline at end of file + gcc -g example.c -o example-static libcmdlineoptions.a + + +compile-tests: + gcc -I. -g tests.c -o tests-shared -L. -lcmdlineoptions + gcc tests.c -o tests-static libcmdlineoptions.a + +test: + LD_LIBRARY_PATH="." tests-shared + tests-static \ No newline at end of file diff --git a/c/tests.c b/c/tests.c index 78fdef5..9f8a320 100644 --- a/c/tests.c +++ b/c/tests.c @@ -23,7 +23,26 @@ void configureDefaultSet(){ int main(int argc, char** argv) { + // configure the options + configureDefaultSet(); + // emulate parameters + int myargc = 0; + char** myargv = 0; + + // test 1 parse nothing. + CmdLO_Parse(myargc,myargv); + + // check contents... + + + // test 2 parse everything + + + // test 3 parse something + + + // test 4 producing some errors... return 0;