- jbj: extend coverage to several additional setup routines.

This commit is contained in:
Jeff Johnson
2008-05-05 20:29:45 +00:00
parent 011bb004f8
commit b12e1c5bde
5 changed files with 13 additions and 4 deletions
View File
+1
View File
@@ -1,4 +1,5 @@
1.14 -> 1.15:
- jbj: extend coverage to several additional setup routines.
- jbj: add tests for --usage/--help coverage.
- jbj: add lconv/gcov targets to Makefile.am.
- jbj: refactor automagic (*opt->arg) option arg store to poptSaveArg().
+3 -2
View File
@@ -1,4 +1,5 @@
test1 alias --simple --arg2
test1 alias --simple --arg2 \
--POPTdesc=$"simple description" --POPTargs=$"ARG"
test1 alias --two --arg1 --arg2 alias
test1 alias --takerest --
test1 alias -T --arg2
@@ -7,6 +8,6 @@ test1 alias -O --arg1
test1 alias --grab --arg2 "'foo !#:+'"
test1 alias --grabbar --grab bar
test1 exec --echo-args echo
test1 exec --echo-args /bin/echo
test1 alias -e --echo-args
test1 exec -a /bin/echo
+4
View File
@@ -161,6 +161,7 @@ static struct poptOption options[] = {
NULL, NULL },
{ NULL, '\0', POPT_ARG_INCLUDE_TABLE, &callbackArgs, 0,
"Callback arguments", NULL },
POPT_AUTOALIAS
POPT_AUTOHELP
POPT_TABLEEND
};
@@ -230,6 +231,9 @@ int main(int argc, const char ** argv)
optCon = poptGetContext("test1", argc, argv, options, 0);
/*@=temptrans@*/
(void) poptReadConfigFile(optCon, "./test-poptrc");
(void) poptReadDefaultConfig(optCon, 1);
poptSetExecPath(optCon, ".", 1);
#if 1
while ((rc = poptGetNextOpt(optCon)) > 0) /* Read all the options ... */
+5 -2
View File
@@ -7,7 +7,7 @@ run() {
echo Running test $name.
result=`$builddir/$prog $*`
result=`HOME=$builddir $builddir/$prog $*`
if [ "$answer" != "$result" ]; then
echo "Test \"$prog $*\" failed with: \"$result\" != \"$answer\" "
exit 2
@@ -111,7 +111,7 @@ Usage: lt-test1 [-I?] [-c|--cb2=STRING] [--arg1] [-2|--arg2=ARG]
[-f|--float=FLOAT] [-d|--double=DOUBLE] [--randint=INT]
[--randlong=LONG] [--randlonglong=LONGLONG] [--argv] [--bitset]
[--bitclr] [--nstr=STRING] [--lstr=STRING] [-I|--inc]
[-c|--cb=STRING] [--longopt] [-?|--help] [--usage]" --usage
[-c|--cb=STRING] [--longopt] [-?|--help] [--usage] [--simple=ARG]" --usage
run test1 "test1 - 51" "\
Usage: lt-test1 [OPTION...]
@@ -151,6 +151,9 @@ Callback arguments
-c, --cb=STRING Test argument callbacks
--longopt Unused option for help testing
Options implemented via popt alias/exec:
--simple=ARG simple description
Help options:
-?, --help Show this help message
--usage Display brief usage message" --help