From: Michal Sojka Date: Fri, 18 Feb 2011 21:40:50 +0000 (+0100) Subject: forb: Add tests for forbrun command line parameters X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/forb.git/commitdiff_plain/29cb923948f5db504004cf93dff0de42f40203c1 forb: Add tests for forbrun command line parameters --- diff --git a/src/forbrun/tests/Makefile.omk b/src/forbrun/tests/Makefile.omk index 2eaa706..220ab1c 100644 --- a/src/forbrun/tests/Makefile.omk +++ b/src/forbrun/tests/Makefile.omk @@ -8,6 +8,10 @@ shared_LIBRARIES += test_client test_client_SOURCES = test_client.c test_client_CLIENT_IDL = test_obj.idl +shared_LIBRARIES += forbrun_printargs +forbrun_printargs_SOURCES = forbrun_printargs.c + + INCLUDES += -I. lib_LOADLIBES = forb ulut fosa rt wvtest diff --git a/src/forbrun/tests/forbrun.sh b/src/forbrun/tests/forbrun.sh index 7c5fde1..0faad99 100755 --- a/src/forbrun/tests/forbrun.sh +++ b/src/forbrun/tests/forbrun.sh @@ -5,7 +5,18 @@ WVSTART "Without any parameters do nothing" WVPASS forbrun -WVSTART "argv[0] in forb_main() contains the name of the library" +WVSTART "Passing of command line parameters to forb_main() in libraries" +WVPASS sh -c 'forbrun -- libforbrun_printargs.so \ + -- libforbrun_printargs.so 1 2 3 4 \ + -- libforbrun_printargs.so --exit > output' +cat < expected +libforbrun_printargs.so +libforbrun_printargs.so 1 2 3 4 +libforbrun_printargs.so --exit +EOF +WVPASS diff -u expected output + +WVSTART "Non-zero return value in forb_main() causes forbrun to fail " WVFAIL sh -c 'forbrun -- libtest_obj.so 2> error' WVPASSEQ "$(cat error)" "Usage: libtest_obj.so " diff --git a/src/forbrun/tests/forbrun_printargs.c b/src/forbrun/tests/forbrun_printargs.c new file mode 100644 index 0000000..86aa4eb --- /dev/null +++ b/src/forbrun/tests/forbrun_printargs.c @@ -0,0 +1,17 @@ +#include +#include + +int forb_main(forb_orb orb, int argc, char *argv[]) +{ + int i; + for (i=0; i