automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-351-g


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.11-351-gd53f5cd
Date: Sat, 23 Apr 2011 08:15:54 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Automake".

http://git.sv.gnu.org/gitweb/?p=automake.git;a=commitdiff;h=d53f5cd99c0946f77ff473e44db13514cc062837

The branch, maint has been updated
       via  d53f5cd99c0946f77ff473e44db13514cc062837 (commit)
      from  5d1f3f0c14af19df45406386b514008916f7d80b (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                                          |   13 +++++++++++++
 tests/Makefile.am                                  |    9 ++++++---
 tests/Makefile.in                                  |   10 +++++++---
 tests/defs.in                                      |   11 +++++++++++
 ...me-in-env.test => self-check-env-sanitize.test} |   10 ++++++----
 5 files changed, 43 insertions(+), 10 deletions(-)
 rename tests/{self-check-me-in-env.test => self-check-env-sanitize.test} (72%)

diff --git a/ChangeLog b/ChangeLog
index b139a98..4417d9b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2011-04-22  Stefano Lattarini  <address@hidden>
+
+       testsuite: more environment sanitization
+       * tests/defs.in: Sanity check: abort if any of `parallel_tests'
+       or `required' is in the environment.
+       ($sed_unindent_prog): Initialize to empty, to avoid interferences
+       from the environment.
+       * tests/self-check-me-in-env.test: Renamed to ...
+       * tests/self-check-env-sanitize.test: ... this, and extended.
+       * tests/Makefile.am (TESTS): Update.
+       (TESTS_ENVIRONMENT): Unset variables `parallel_tests' and
+       `required'.  Adjust comments.
+
 2011-04-18  Stefano Lattarini  <address@hidden>
 
        tests: don't allow `$me' to be overridden from the environment
diff --git a/tests/Makefile.am b/tests/Makefile.am
index cc25167..3fca68e 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -38,12 +38,15 @@ $(parallel_tests): $(parallel_tests:-p.test=.test) 
Makefile.am
 
 MAINTAINERCLEANFILES = $(parallel_tests)
 
-# The testsuite variable `$me' should be overridable from the
+# Some testsuite-influential variables should be overridable from the
 # test scripts, but not from the environment.
-TESTS_ENVIRONMENT = test x"$$me" = x || unset me;
+TESTS_ENVIRONMENT = \
+  test x"$$me" = x || unset me; \
+  test x"$$required" = x || unset required; \
+  test x"$$parallel_tests" = x || unset parallel_tests;
 
 TESTS = \
-self-check-me-in-env.test \
+self-check-env-sanitize.test \
 aclibobj.test \
 aclocal.test \
 aclocal3.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 9ccbdbd..67efb77 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -309,11 +309,15 @@ pr401c-p.test
 
 MAINTAINERCLEANFILES = $(parallel_tests)
 
-# The testsuite variable `$me' should be overridable from the
+# Some testsuite-influential variables should be overridable from the
 # test scripts, but not from the environment.
-TESTS_ENVIRONMENT = test x"$$me" = x || unset me;
+TESTS_ENVIRONMENT = \
+  test x"$$me" = x || unset me; \
+  test x"$$required" = x || unset required; \
+  test x"$$parallel_tests" = x || unset parallel_tests;
+
 TESTS = \
-self-check-me-in-env.test \
+self-check-env-sanitize.test \
 aclibobj.test \
 aclocal.test \
 aclocal3.test \
diff --git a/tests/defs.in b/tests/defs.in
index 342e76d..ef35d9f 100644
--- a/tests/defs.in
+++ b/tests/defs.in
@@ -74,6 +74,16 @@ elif env | grep '^me=' >/dev/null; then
   exit 99
 fi
 
+# Check that the environment is properly sanitized.
+for var in required parallel_tests; do
+  if env | grep "^$var=" >/dev/null; then
+    echo "$me: variable \`$var' is set in the environment:" \
+         "this is unsafe" >&2
+    exit 99
+  fi
+done
+unset var
+
 # This might be used in testcases checking distribution-related features.
 # Test scripts are free to override this if they need to.
 distdir=$me-1.0
@@ -488,6 +498,7 @@ unindent ()
   fi
   sed "$sed_unindent_prog" ${1+"$@"}
 }
+sed_unindent_prog="" # Avoid interferences from the environment.
 
 # Turn on shell traces.
 set -x
diff --git a/tests/self-check-me-in-env.test 
b/tests/self-check-env-sanitize.test
similarity index 72%
rename from tests/self-check-me-in-env.test
rename to tests/self-check-env-sanitize.test
index 344a861..9d18d9e 100755
--- a/tests/self-check-me-in-env.test
+++ b/tests/self-check-env-sanitize.test
@@ -16,13 +16,15 @@
 
 # Sanity check for the automake testsuite.
 # Make sure that the testsuite initialization code complains when
-# $me is set in the environment.
+# some testsuite-influential variables are set in the environment.
 
 set -x
 
 exec 5>&1
-env me=foo /bin/sh -c '. ./defs' foo.test && exit 1
-env me=foo /bin/sh -c '. ./defs' foo.test 2>&1 1>&5 \
-  | grep "variable \`me' is set in the environment.*unsafe" || exit 1
+for var in me parallel_tests required; do
+  env "$var=foo" /bin/sh -c '. ./defs' foo.test && exit 1
+  env "$var=foo" /bin/sh -c '. ./defs' foo.test 2>&1 1>&5 \
+    | grep "variable \`$var' is set in the environment.*unsafe" || exit 1
+done
 
 :


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]