Hash :
c7cfa093
Author :
Date :
2013-05-21T20:22:17
tests: run_make: options to do command redirection
Let's improve the API of the 'run_make()' helper shell function by
adding three new options:
-O Save the standard output from make on disk, in a regular file
named 'stdout'.
-E Save the standard error from make on disk, in a regular file
named 'stderr'.
-M Save both the standard output and standard error from make on
disk, in a regular file named 'output'. This option supersedes
both the '-O' and '-E' options.
This new API has two main advantages.
1. Its use will allow us to get rid of more cumbersome idioms
like, e.g.,
$MAKE check >stdout && { cat stdout; exit 1; }
cat stdout
That can now be substituted with a simpler one:
run_make -e FAIL -O check
2. More importantly, using the new API we will prevent any extra output
from the shell traces of the code in run_make to be redirected along
with the make stderr (where that was redirected). This problem was
present in usages like, e.g.,
run_make TESTS=foo.test check 2>stderr && exit 1
grep 'expected error message' stderr
Such usages are now to be rewritten as follows:
run_make -e FAIL -E TESTS=foo.test check
grep 'expected error message' stderr
ensuring that 'stderr' won't end up containing unrelated stuff.
Note that we do not convert in bulk the old idioms and the use of
redirected 'run_make' invocations with this patch. We only convert
some occurrences, to ensure that the new implementation of 'run_make'
is sound enough. More sweeping conversions will likely be done in
follow-up patches.
* t/ax/am-test-lib.sh (run_make): Enhance and implement the extended API.
* t/tap-xfail-tests.sh: Use the new 'run_make' API.
* t/test-driver-cond.sh: Likewise.
* t/tests-environment-fd-redirect.sh: Likewise.
* t/uninstall-fail.sh: Likewise.
* t/yacc-dist-nobuild.sh: Likewise.
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
This is Automake, a Makefile generator. It aims to be portable and
to conform to the GNU Coding Standards for Makefile variables and
targets.
See the INSTALL file for detailed information about how to configure
and install Automake.
Automake is a Perl script. The input files are called Makefile.am.
The output files are called Makefile.in; they are intended for use
with Autoconf. Automake requires certain things to be done in your
configure.ac.
Automake comes with extensive documentation; please refer to it for
more details about its purpose, features, and usage patterns.
This package also includes the "aclocal" program, whose purpose is
to generate an 'aclocal.m4' based on the contents of 'configure.ac'.
It is useful as an extensible, maintainable mechanism for augmenting
autoconf. It is intended that other package authors will write m4
macros which can be automatically used by aclocal. The documentation
for aclocal is currently found in the Automake manual.
Automake has a test suite. Use "make check" to run it. For more
information, see the file t/README.
Automake has a page on the web. See:
http://www.gnu.org/software/automake/
Automake also has three mailing lists:
* automake@gnu.org
For general discussions of Automake and its interactions with other
configuration/portability tools like Autoconf or Libtool.
* bug-automake@gnu.org
Where to send bug reports and feature requests.
* automake-patches@gnu.org
Where to send patches, and discuss the automake development process
and the design of new features.
To obtain more information about these list, or to subscribe to them,
refer to <http://www.gnu.org/software/automake/#mailinglists>
New releases are announced to autotools-announce@gnu.org. If you want to
be informed, subscribe to that list by following the instructions at
<http://lists.gnu.org/mailman/listinfo/autotools-announce>.
For any copyright year range specified as YYYY-ZZZZ in this package,
that the range specifies every single year in that closed interval.
-----
Copyright (C) 1994-2012 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.