Added tests to makefile.

This commit is contained in:
Marcel 2014-02-22 20:47:27 +00:00
parent 8cdfb9fedb
commit 0aaf6a24c9
2 changed files with 30 additions and 2 deletions

View File

@ -1,6 +1,6 @@
all: build static-lib dynamic-lib example all: build static-lib dynamic-lib example compile-tests
build: build:
gcc -c -g cmdlineoptions.c gcc -c -g cmdlineoptions.c
@ -21,3 +21,12 @@ clean:
example: example:
gcc -I. -g example.c -o example-shared -L. -lcmdlineoptions gcc -I. -g example.c -o example-shared -L. -lcmdlineoptions
gcc -g example.c -o example-static libcmdlineoptions.a 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

View File

@ -23,7 +23,26 @@ void configureDefaultSet(){
int main(int argc, char** argv) { 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; return 0;