From: Stefano Lattarini Date: Tue, 11 Jan 2011 02:17:10 +0000 (+0100) Subject: tests: more consistent checks about invalid options X-Git-Tag: ng-0.5a~267 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7acd6bbef482c67e03a3c0ac2878ae7af60307e;p=thirdparty%2Fautomake.git tests: more consistent checks about invalid options * tests/aclocal.test: Grepping of automake stderr for messages reporting invalid options made stricter. * tests/no-outdir-option.test: Likewise. Also, create a dummy `Makefile.am', to ensure that the automake failures are really caused only by unrecognized options. * tests/automake.test: Added trailing `:' command. Removed redundant checks on `--help' and `--version' option (already performed in the test `help*.test'). --- diff --git a/ChangeLog b/ChangeLog index c2d5661e6..7798c5ee8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2011-01-11 Stefano Lattarini + + tests: more consistent checks about invalid options + * tests/aclocal.test: Grepping of automake stderr for messages + reporting invalid options made stricter. + * tests/no-outdir-option.test: Likewise. Also, create a dummy + `Makefile.am', to ensure that the automake failures are really + caused only by unrecognized options. + * tests/automake.test: Added trailing `:' command. Removed + redundant checks on `--help' and `--version' option (already + performed in the test `help*.test'). + 2011-01-11 Stefano Lattarini tests: enable 'errexit' shell flag by default. diff --git a/tests/aclocal.test b/tests/aclocal.test index 539fb01b7..64b72e156 100755 --- a/tests/aclocal.test +++ b/tests/aclocal.test @@ -24,17 +24,17 @@ test -f fred $ACLOCAL --output 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 -grep 'option.*--output.*an argument' stderr +grep 'option.*--output.*requires an argument' stderr grep '[Tt]ry.*--help.*for more information' stderr $ACLOCAL --unknown-option 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 -grep 'unrecognized.*--unknown-option' stderr +grep 'unrecognized option.*--unknown-option' stderr grep '[Tt]ry.*--help.*for more information' stderr $ACLOCAL --ver 2>stderr && { cat stderr >&2; Exit 1; } cat stderr >&2 -grep 'unrecognized.*--ver' stderr +grep 'unrecognized option.*--ver' stderr grep '[Tt]ry.*--help.*for more information' stderr $ACLOCAL --versi diff --git a/tests/automake.test b/tests/automake.test index 060720c46..98018a127 100755 --- a/tests/automake.test +++ b/tests/automake.test @@ -17,8 +17,6 @@ # Test Automake's command-line options. . ./defs || Exit 1 -$AUTOMAKE --help -$AUTOMAKE --version AUTOMAKE_fails --voo grep 'unrecognized option.*--voo' stderr # older perl has a buggy Getopt::Long which makes this fail. @@ -37,3 +35,5 @@ grep 'unknown warning.*--help' stderr AUTOMAKE_fails --ver grep 'unrecognized option.*--ver' stderr $AUTOMAKE --vers + +: diff --git a/tests/no-outdir-option.test b/tests/no-outdir-option.test index 748a2338b..85921fc93 100755 --- a/tests/no-outdir-option.test +++ b/tests/no-outdir-option.test @@ -18,10 +18,12 @@ . ./defs || Exit 1 +: > Makefile.am + AUTOMAKE_fails -Wno-error --output-dir=foo -$EGREP '(invalid|unrecognized) option.*--output-dir' stderr +grep 'unrecognized option.*--output-dir' stderr AUTOMAKE_fails -Wno-error -o foo -$EGREP '(invalid|unrecognized) option.*-o' stderr +grep 'unrecognized option.*-o' stderr :