From a7acd6bbef482c67e03a3c0ac2878ae7af60307e Mon Sep 17 00:00:00 2001 From: Stefano Lattarini Date: Tue, 11 Jan 2011 03:17:10 +0100 Subject: [PATCH] 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'). --- ChangeLog | 12 ++++++++++++ tests/aclocal.test | 6 +++--- tests/automake.test | 4 ++-- tests/no-outdir-option.test | 6 ++++-- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2d5661..7798c5e 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 539fb01..64b72e1 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 060720c..98018a1 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 748a233..85921fc 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 : -- 2.7.4