Related to automake bug#8508. * tests/self-check-cleanup.test: Be laxer when grepping output from `ls -l', to account for ACLs and SELinux-only files. * tests/self-check-dir.test: Source `defs-static' to read in the correct definition for $SHELL. * tests/self-check-me.test: Likewise, and extend a bit.
Report from Jim Meyering. -*-*- Applied to a temporary bug-fixing branch, merged into master, and pushed. Regards, Stefano
From d15f27e30da26bf6d39538b17d4a8d5560a1551d Mon Sep 17 00:00:00 2001 From: Stefano Lattarini <stefano.lattar...@gmail.com> Date: Sat, 16 Apr 2011 14:32:29 +0200 Subject: [PATCH] tests: fix few bugs in self checks Related to automake bug#8508. * tests/self-check-cleanup.test: Be laxer when grepping output from `ls -l', to account for ACLs and SELinux-only files. * tests/self-check-dir.test: Source `defs-static' to read in the correct definition for $SHELL. * tests/self-check-me.test: Likewise, and extend a bit. Report from Jim Meyering. --- ChangeLog | 11 +++++++++++ tests/self-check-cleanup.test | 8 ++++---- tests/self-check-dir.test | 2 ++ tests/self-check-me.test | 5 +++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5ef0c0d..7823631 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2011-04-16 Stefano Lattarini <stefano.lattar...@gmail.com> + + tests: fix few bugs in self checks + Related to automake bug#8508. + * tests/self-check-cleanup.test: Be laxer when grepping output + from `ls -l', to account for ACLs and SELinux-only files. + * tests/self-check-dir.test: Source `defs-static' to read in the + correct definition for $SHELL. + * tests/self-check-me.test: Likewise, and extend a bit. + Report from Jim Meyering. + 2011-02-25 Stefano Lattarini <stefano.lattar...@gmail.com> tests: add testcases sanity-checking the testsuite diff --git a/tests/self-check-cleanup.test b/tests/self-check-cleanup.test index 92a203e..390d9b5 100755 --- a/tests/self-check-cleanup.test +++ b/tests/self-check-cleanup.test @@ -87,8 +87,8 @@ if $have_symlinks; then cd .. $SHELL -c '. ./defs' dummy.test ls -l # For debugging. - ls -l file | grep "^---------- .*file" - ls -ld dir | grep "^d--------- .*dir" + ls -l file | grep "^----------.*file" + ls -ld dir | grep "^d---------.*dir" $SHELL -c ' ocwd=`pwd` || exit 1 @@ -96,8 +96,8 @@ if $have_symlinks; then ln -s "$ocwd/dir" "$ocwd/file" . ' dummy.test ls -l # For debugging. - ls -l file | grep "^---------- .*file" - ls -ld dir | grep "^d--------- .*dir" + ls -l file | grep "^----------.*file" + ls -ld dir | grep "^d---------.*dir" rmdir dir rm -f file diff --git a/tests/self-check-dir.test b/tests/self-check-dir.test index a8e5d88..ba9fd29 100755 --- a/tests/self-check-dir.test +++ b/tests/self-check-dir.test @@ -18,6 +18,8 @@ # Check that tests using `./defs' create a proper temporary directory, # and run in it. +. ./defs-static || exit 1 + set -ex this=S_dir diff --git a/tests/self-check-me.test b/tests/self-check-me.test index 5773e2c..141857f 100755 --- a/tests/self-check-me.test +++ b/tests/self-check-me.test @@ -17,13 +17,14 @@ # Sanity check for the automake testsuite. # Make sure that $me gets automatically defined by `./defs'. -set -ex +. ./defs-static || exit 1 -: ${SHELL=/bin/sh} +set -ex $SHELL -c '. ./defs && echo me=$me' foo-bar-.test | grep '^me=foo-bar-$' $SHELL -c '. ./defs && echo me=$me' _foo__bar.test | grep '^me=_foo__bar$' $SHELL -c '. ./defs && echo me=$me' 012.test | grep '^me=012$' $SHELL -c '. ./defs && echo me=$me' foo.bar | grep '^me=foo\.bar$' +$SHELL -c '. ./defs && echo me=$me' a.b.c.test | grep '^me=a\.b\.c$' : -- 1.7.2.3