[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] init.sh docs: prefer AM_TESTS_SETUP to TESTS_ENVIRONMENT
From: |
Stefano Lattarini |
Subject: |
Re: [PATCH] init.sh docs: prefer AM_TESTS_SETUP to TESTS_ENVIRONMENT |
Date: |
Tue, 19 Apr 2011 10:06:43 +0200 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
On Sunday 17 April 2011, Stefano Lattarini wrote:
> Hello Gnulibers.
>
> The latest developement version of Automake has finally implemented
> the support for the developer-reserved variable `AM_TESTS_SETUP',
> which can be used to run initialization code and set environment
> variables for the testsuite (when the "parallel-tests" option is
> used) without invading the user's namespace.
>
> I'd thus like to update the documentation in gnulib's `tests/init.sh'
> consequently, suggesting to use `AM_TESTS_SETUP' instead of the older
> and not namespace-safe `TESTS_ENVIRONMENT' (which can now truly be
> reserved for user's own customization and overrides).
>
> My tentative patch is attached. Note that I've not put "tiny change"
> in the ChangeLog entry because I've finally signed the copyright
> assignment for Gnulib too.
>
> Regards,
> Stefano
>
In the meantime, the `AM_TESTS_SETUP' variable as been renamed
to `AM_TEST_ENVIRONMENT', for consistency with the older
`TESTS_ENVIRONMENT'. I've thus updated my patch for Gnulib
accordingly; the new version is attached.
Thanks, and sorry for the noise,
Stefano
From 62c849649576be52cdc542cc1f35bef2c18070d7 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Sun, 17 Apr 2011 20:43:18 +0200
Subject: [PATCH] init.sh docs: prefer AM_TESTS_ENVIRONMENT to TESTS_ENVIRONMENT
* tests/init.sh: In the comments documenting usage and interface
of this script, suggest the use of Automake special variable
`AM_TESTS_ENVIRONMENT' rather than `TESTS_ENVIRONMENT', when
the first is available (i.e., for Automake >= 1.12 when the
"parallel-tests" option is used). For more information, see
the original mailing list discussion at:
<http://lists.gnu.org/archive/html/automake-patches/2011-01/msg00213.html>
---
ChangeLog | 11 +++++++++++
tests/init.sh | 20 +++++++++++++-------
2 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index c81be0c..c9c6722 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2011-04-19 Stefano Lattarini <address@hidden>
+
+ init.sh docs: prefer AM_TESTS_ENVIRONMENT to TESTS_ENVIRONMENT
+ * tests/init.sh: In the comments documenting usage and interface
+ of this script, suggest the use of Automake special variable
+ `AM_TESTS_ENVIRONMENT' rather than `TESTS_ENVIRONMENT', when
+ the first is available (i.e., for Automake >= 1.12 when the
+ "parallel-tests" option is used). For more information, see
+ the original mailing list discussion at:
+
<http://lists.gnu.org/archive/html/automake-patches/2011-01/msg00213.html>
+
2011-04-16 Bruno Haible <address@hidden>
gettext: Clarify the needed programmer actions.
diff --git a/tests/init.sh b/tests/init.sh
index 71c6516..40e0e15 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -30,7 +30,9 @@
# For example, if the programs you want to test are in src/, and this test
# script is named tests/test-1, then you would use "path_prepend_ ../src",
# or perhaps export PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH"
-# to all tests via automake's TESTS_ENVIRONMENT.
+# to all tests via automake's AM_TESTS_ENVIRONMENT (if you are using an
+# automake version earlier than 1.12, or are not using the "parallel-tests"
+# option, you'll have to use the variable TEST_ENVIRONMENT instead).
# Set the exit code 0 for success, 77 for skipped, or 1 or other for failure.
# Use the skip_ and fail_ functions to print a diagnostic and then exit
# with the corresponding exit code.
@@ -48,8 +50,9 @@
# Running a single test, with single-stepping:
# 1. Go into a sub-shell:
# $ bash
-# 2. Set relevant environment variables from TESTS_ENVIRONMENT in the
-# Makefile:
+# 2. Run the setup code from AM_TESTS_ENVIRONMENT or TESTS_ENVIRONMENT
+# in the Makefile (in most situations, this will consist only of
+# assignments of relevant environment variables):
# $ export srcdir=../../tests # this is an example
# 3. Execute the commands from the test, copy&pasting them one by one:
# $ . "$srcdir/init.sh"; path_prepend_ .
@@ -68,10 +71,13 @@ Exit () { set +e; (exit $1); exit $1; }
# Print warnings (e.g., about skipped and failed tests) to this file number.
# Override by defining to say, 9, in init.cfg, and putting say,
-# "export ...ENVVAR_SETTINGS...; exec 9>&2; $(SHELL)" in the definition
-# of TESTS_ENVIRONMENT in your tests/Makefile.am file.
-# This is useful when using automake's parallel tests mode, to print
-# the reason for skip/failure to console, rather than to the .log files.
+# "export ...ENVVAR_SETTINGS...; exec 9>&2;" in the definition of
+# AM_TESTS_ENVIRONMENT in your tests/Makefile.am file (note that if you're
+# using an automake version earlier than 1.12, or are not using the
+# "parallel-tests" option, you'll have to use TEST_ENVIRONMENT instead).
+# This is especially useful when using automake's parallel tests mode,
+# to print the reason for skip/failure to console, rather than to the
+# .log files.
: ${stderr_fileno_=2}
warn_ () { echo "$@" 1>&$stderr_fileno_; }
--
1.7.2.3