automake-patches
[Top][All Lists]
Advanced

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

Re: [PATCH] {maint} tests: new subroutines for test skipping/failing


From: Stefano Lattarini
Subject: Re: [PATCH] {maint} tests: new subroutines for test skipping/failing
Date: Mon, 18 Apr 2011 00:54:13 +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:
> On Sunday 17 April 2011, Ralf Wildenhues wrote:
> > Hello Stefano,
> >
> > * Stefano Lattarini wrote on Sun, Apr 17, 2011 at 03:27:17PM CEST:
> > > Reference:
> > >   
> > > <http://lists.gnu.org/archive/html/automake-patches/2011-03/msg00052.html>
> > > 
> > > On Wednesday 30 March 2011, Stefano Lattarini wrote:
> > > > > > >   $(AM_TESTS_SETUP) $(TESTS_SETUP) $(TESTS_ENVIRONMENT)
> > 
> > I think the AM_TESTS_SETUP naming is not a good one.  It may be
> > technically more correct than AM_TESTS_ENVIRONMENT, but I think
> > the latter is the better one simply because it is easier to remember,
> > and even if you've never heard of it and only know the semantics of
> > TESTS_ENVIRONMENT, you can have a straightforward way to figure out
> > how AM_TESTS_ENVIRONMENT would work.
> > 
> > Can we agree to rename it?
> >
> No problem, the important thing for me is to have that variable available
> ASAP, with one name or another (and your choice of a name is backed up by
> good reasons too, BTW).  I'm probably going offline shortly, but I'll do
> the rename tomorrow (if you don't want to beat me at it).
> 
> > Sorry for jumping out now, and for not coming forward with a review
> > earlier.
> >
> No big deal -- there's no release planned in the next days, so IMHO
> we can afford a little more churn if that helps to get things done.
> 
> Regards,
>   Stefano
> 
Done in the attached patch.  I'll push by tomorrow evening if there's
no objection.

Thanks,
  Stefano
From 12f48fafa9643fd497c958545f2990d2bfc6abb1 Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Mon, 18 Apr 2011 00:52:03 +0200
Subject: [PATCH] check: rename AM_TESTS_SETUP -> AM_TESTS_ENVIRONMENT

The AM_TESTS_SETUP naming was not a good one after all.  It may
be technically more correct than AM_TESTS_ENVIRONMENT, but the
latter is a better one simply because it is easier to remember,
and even if you've never heard of it and only know the semantics
of TESTS_ENVIRONMENT, you can have a straightforward way to
figure out how AM_TESTS_ENVIRONMENT would work.

* tests/check.am (am__check_pre): Update.
* doc/automake.in (Simple Tests using parallel-tests): Update.
* tests/parallel-tests-am_tests_setup.test: Renamed ...
* tests/parallel-tests-am_tests_environment.test: ... to this,
and updated.
* tests/Makefile.am (TESTS): Update.

Suggestion and motivation by Ralf Wildenhues.
---
 ChangeLog                                          |   17 ++++++++
 doc/automake.texi                                  |   42 ++++++++++----------
 lib/Automake/tests/Makefile.in                     |   10 ++--
 lib/am/check.am                                    |   10 ++--
 tests/Makefile.am                                  |    2 +-
 tests/Makefile.in                                  |   12 +++---
 ...st => parallel-tests-am_tests_environment.test} |    6 +-
 7 files changed, 58 insertions(+), 41 deletions(-)
 rename tests/{parallel-tests-am_tests_setup.test => 
parallel-tests-am_tests_environment.test} (91%)

diff --git a/ChangeLog b/ChangeLog
index ed1d4aa..f121e0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,20 @@
+2011-04-18  Stefano Lattarini  <address@hidden>
+
+       check: rename AM_TESTS_SETUP -> AM_TESTS_ENVIRONMENT
+       The AM_TESTS_SETUP naming was not a good one after all.  It may
+       be technically more correct than AM_TESTS_ENVIRONMENT, but the
+       latter is a better one simply because it is easier to remember,
+       and even if you've never heard of it and only know the semantics
+       of TESTS_ENVIRONMENT, you can have a straightforward way to
+       figure out how AM_TESTS_ENVIRONMENT would work.
+       * tests/check.am (am__check_pre): Update.
+       * doc/automake.in (Simple Tests using parallel-tests): Update.
+       * tests/parallel-tests-am_tests_setup.test: Renamed ...
+       * tests/parallel-tests-am_tests_environment.test: ... to this,
+       and updated.
+       * tests/Makefile.am (TESTS): Update.
+       Suggestion and motivation by Ralf Wildenhues.
+
 2011-04-17  Stefano Lattarini  <address@hidden>
 
        check: new developer-reserved AM_TESTS_SETUP variable
diff --git a/doc/automake.texi b/doc/automake.texi
index 6692e7f..7394253 100644
--- a/doc/automake.texi
+++ b/doc/automake.texi
@@ -8664,7 +8664,7 @@ for exceptional failures.  Similar to the simple test 
driver,
 the @code{check_*} variables are honored, and the environment variable
 @env{srcdir} is set during test execution. Also, @code{TESTS_ENVIRONMENT}
 is still honored, but is complemented by a new developer-reserved variable
address@hidden (described below).
address@hidden (described below).
 
 This test driver is still experimental and may undergo changes in order
 to satisfy additional portability requirements.
@@ -8736,27 +8736,27 @@ and @samp{./wrapper-script -d baz} to produce 
@file{foo.log},
 @samp{TESTS_ENVIRONMENT} variable is still expanded before the driver,
 but should be reserved for the user.
 
address@hidden AM_TESTS_SETUP
-The @code{AM_TESTS_SETUP} variable can be used to run initialization code
-and set environment variables for the tests' runs.  The user can still
-employ the @code{TESTS_ENVIRONMENT} variable to override settings from
address@hidden  Note that, for implementation reasons, if the
address@hidden variable is set, its contents @emph{must} be
-terminated by a semicolon.
-
address@hidden
-# The tests below are expected to use the file descriptor passed
-# in the environment variable 'warn_fileno' to print warnings
-# (e.g., about skipped and failed tests).  If this variable were
-# to be set to `2' (i.e. default stderr), the warnings would be
-# redirected by the automake parallel-tests driver into the .log
-# files.  But the AM_TESTS_SETUP definition below will cause the
-# reasons for skip/failure to be printed to the console instead.
-# The user can still override this by setting TESTS_ENVIRONMENT
-# to e.g. `warn_fileno=2' at make runtime, which will cause the
-# warnings to be sent to the .log files again.
address@hidden AM_TESTS_ENVIRONMENT
+The @code{AM_TESTS_ENVIRONMENT} variable can be used to run initialization
+code and set environment variables for the tests' runs.  The user can
+still employ the @code{TESTS_ENVIRONMENT} variable to override settings
+from @code{AM_TESTS_ENVIRONMENT}.  Note that, for implementation reasons,
+if the @code{AM_TESTS_ENVIRONMENT} variable is set, its contents
address@hidden be terminated by a semicolon.
+
address@hidden
+# The tests below are expected to use the file descriptor passed in
+# the environment variable 'warn_fileno' to print warnings (e.g.,
+# about skipped and failed tests).  If this variable were to be set
+# to `2' (i.e. default stderr), the warnings would be redirected by
+# the automake parallel-tests driver into the .log files.  But the
+# AM_TESTS_ENVIRONMENT definition below will cause the reasons for
+# skip/failure to be printed to the console instead.  The user
+# can still override this by setting TESTS_ENVIRONMENT to e.g.
+# `warn_fileno=2' at make runtime, which will cause the warnings
+# to be sent to the .log files again.
 TESTS = test1.sh test2.sh ...
-AM_TESTS_SETUP = exec 9>&2; warn_fileno=9; export warn_fileno;
+AM_TESTS_ENVIRONMENT = exec 9>&2; warn_fileno=9; export warn_fileno;
 @end example
 
 @trindex mostlyclean
diff --git a/lib/Automake/tests/Makefile.in b/lib/Automake/tests/Makefile.in
index bea7a8d..b1916a8 100644
--- a/lib/Automake/tests/Makefile.in
+++ b/lib/Automake/tests/Makefile.in
@@ -122,10 +122,10 @@ am__sh_e_setup = case $$- in *e*) set +e;; esac
 # To be inserted before the command running the test.  Creates the
 # directory for the log if needed.  Stores in $dir the directory
 # containing $f, in $tst the test, in $log the log.  Executes the
-# developer- defined test setup AM_TESTS_SETUP (if any), and passes
-# TESTS_ENVIRONMENT.  Saves and restores TERM around uses of
-# TESTS_ENVIRONMENT and AM_TESTS_SETUP, in case any of them unsets
-# it.
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Saves and restores TERM around uses of
+# TESTS_ENVIRONMENT and AM_TESTS_ENVIRONMENT, in case any of them
+# unsets it.
 am__check_pre = \
 $(am__sh_e_setup);                                     \
 $(am__vpath_adj_setup) $(am__vpath_adj)                        \
@@ -140,7 +140,7 @@ if test -f "./$$f"; then dir=./;                    \
 elif test -f "$$f"; then dir=;                         \
 else dir="$(srcdir)/"; fi;                             \
 tst=$$dir$$f; log='$@'; __SAVED_TERM=$$TERM;           \
-$(AM_TESTS_SETUP)                                      \
+$(AM_TESTS_ENVIRONMENT)                                        \
 $(TESTS_ENVIRONMENT)
 # To be appended to the command running the test.  Handle the stdout
 # and stderr redirection, and catch the exit status.
diff --git a/lib/am/check.am b/lib/am/check.am
index 1827e01..97ecb68 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -94,10 +94,10 @@ am__sh_e_setup = case $$- in *e*) set +e;; esac
 # To be inserted before the command running the test.  Creates the
 # directory for the log if needed.  Stores in $dir the directory
 # containing $f, in $tst the test, in $log the log.  Executes the
-# developer- defined test setup AM_TESTS_SETUP (if any), and passes
-# TESTS_ENVIRONMENT.  Saves and restores TERM around uses of
-# TESTS_ENVIRONMENT and AM_TESTS_SETUP, in case any of them unsets
-# it.
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Saves and restores TERM around uses of
+# TESTS_ENVIRONMENT and AM_TESTS_ENVIRONMENT, in case any of them
+# unsets it.
 am__check_pre =                                                \
 $(am__sh_e_setup);                                     \
 $(am__vpath_adj_setup) $(am__vpath_adj)                        \
@@ -112,7 +112,7 @@ if test -f "./$$f"; then dir=./;                    \
 elif test -f "$$f"; then dir=;                         \
 else dir="$(srcdir)/"; fi;                             \
 tst=$$dir$$f; log='$@'; __SAVED_TERM=$$TERM;           \
-$(AM_TESTS_SETUP)                                      \
+$(AM_TESTS_ENVIRONMENT)                                        \
 $(TESTS_ENVIRONMENT)
 
 # To be appended to the command running the test.  Handle the stdout
diff --git a/tests/Makefile.am b/tests/Makefile.am
index c6006e3..3c98cfc 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -580,7 +580,7 @@ parallel-tests7.test \
 parallel-tests8.test \
 parallel-tests9.test \
 parallel-tests10.test \
-parallel-tests-am_tests_setup.test \
+parallel-tests-am_tests_environment.test \
 parallel-tests-unreadable-log.test \
 parallel-tests-subdir.test \
 parse.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 40744a4..36a63ce 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -125,10 +125,10 @@ am__sh_e_setup = case $$- in *e*) set +e;; esac
 # To be inserted before the command running the test.  Creates the
 # directory for the log if needed.  Stores in $dir the directory
 # containing $f, in $tst the test, in $log the log.  Executes the
-# developer- defined test setup AM_TESTS_SETUP (if any), and passes
-# TESTS_ENVIRONMENT.  Saves and restores TERM around uses of
-# TESTS_ENVIRONMENT and AM_TESTS_SETUP, in case any of them unsets
-# it.
+# developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and
+# passes TESTS_ENVIRONMENT.  Saves and restores TERM around uses of
+# TESTS_ENVIRONMENT and AM_TESTS_ENVIRONMENT, in case any of them
+# unsets it.
 am__check_pre = \
 $(am__sh_e_setup);                                     \
 $(am__vpath_adj_setup) $(am__vpath_adj)                        \
@@ -143,7 +143,7 @@ if test -f "./$$f"; then dir=./;                    \
 elif test -f "$$f"; then dir=;                         \
 else dir="$(srcdir)/"; fi;                             \
 tst=$$dir$$f; log='$@'; __SAVED_TERM=$$TERM;           \
-$(AM_TESTS_SETUP)                                      \
+$(AM_TESTS_ENVIRONMENT)                                        \
 $(TESTS_ENVIRONMENT)
 # To be appended to the command running the test.  Handle the stdout
 # and stderr redirection, and catch the exit status.
@@ -853,7 +853,7 @@ parallel-tests7.test \
 parallel-tests8.test \
 parallel-tests9.test \
 parallel-tests10.test \
-parallel-tests-am_tests_setup.test \
+parallel-tests-am_tests_environment.test \
 parallel-tests-unreadable-log.test \
 parallel-tests-subdir.test \
 parse.test \
diff --git a/tests/parallel-tests-am_tests_setup.test 
b/tests/parallel-tests-am_tests_environment.test
similarity index 91%
rename from tests/parallel-tests-am_tests_setup.test
rename to tests/parallel-tests-am_tests_environment.test
index bf0d0c6..072e614 100755
--- a/tests/parallel-tests-am_tests_setup.test
+++ b/tests/parallel-tests-am_tests_environment.test
@@ -14,8 +14,8 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-# parallel-tests: check AM_TESTS_SETUP support, and its interaction
-# with TESTS_ENVIRONMENT.
+# parallel-tests: check AM_TESTS_ENVIRONMENT support, and its
+# interactions with TESTS_ENVIRONMENT.
 
 parallel_tests=yes
 . ./defs || Exit 1
@@ -31,7 +31,7 @@ cat > Makefile.am << 'END'
 TEST_EXTENSIONS = .sh .test
 TESTS = foo.test bar.sh
 SH_LOG_COMPILER = sh
-AM_TESTS_SETUP = $(MKDIR_P) quux.dir; exec 9>&2; fd=9; export fd;
+AM_TESTS_ENVIRONMENT = $(MKDIR_P) quux.dir; exec 9>&2; fd=9; export fd;
 EXTRA_DIST = $(TESTS)
 END
 
-- 
1.7.2.3


reply via email to

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