mirror of
https://github.com/openharmony/third_party_popt.git
synced 2026-07-01 03:23:16 -04:00
- jbj: extend coverage to several additional setup routines.
This commit is contained in:
@@ -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
@@ -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
|
||||
|
||||
@@ -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 ... */
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user