From: Stefano Lattarini Date: Sun, 5 Jun 2011 18:58:21 +0000 (+0200) Subject: self tests: check that `$me' can be overridden X-Git-Tag: ng-0.5a~89^2~198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=145b591c8f676257685faf9cd8faffd92e1a9e5d;p=thirdparty%2Fautomake.git self tests: check that `$me' can be overridden * tests/self-check-me.test: Check that `$me' can be overridden before sourcing ./defs, with or without sourcing ./defs-static beforehand, and that this override is honored. Update heading comments. --- diff --git a/ChangeLog b/ChangeLog index 569f44add..c57e2c598 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2011-06-05 Stefano Lattarini + + self tests: check that `$me' can be overridden + * tests/self-check-me.test: Check that `$me' can be overridden + before sourcing ./defs, with or without sourcing ./defs-static + beforehand, and that this override is honored. Update heading + comments. + 2011-06-02 Stefano Lattarini self tests: fix another spurious failure diff --git a/tests/self-check-me.test b/tests/self-check-me.test index 8fd2bc09a..e8b136137 100755 --- a/tests/self-check-me.test +++ b/tests/self-check-me.test @@ -15,7 +15,8 @@ # along with this program. If not, see . # Sanity check for the automake testsuite. -# Make sure that $me gets automatically defined by `./defs'. +# Make sure that $me gets automatically defined by `./defs', and that it +# can be overridden by the test script. . ./defs-static || exit 1 @@ -29,4 +30,16 @@ $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$' +# Overriding $me after sourcing ./defs-static should work. +s=`$SHELL -c '. ./defs-static && me=zardoz && . ./defs && echo me=$me' \ + bad.test` || exit 1 +printf '%s\n' "$s" | grep '^me=zardoz$' +printf '%s\n' "$s" | grep 'me=bad' && exit 1 + +# If we override $me, ./defs should not modify it. +s=`$SHELL -c 'me=foo.test && . ./defs && echo me=$me' \ + bad.test` || exit 1 +printf '%s\n' "$s" | grep '^me=foo\.test$' +printf '%s\n' "$s" | grep 'me=bad' && exit 1 + :