2009-04-04 Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
+ parallel-tests: LOG_COMPILER for tests without known extension.
+ * automake.in (handle_tests): If we don't match a known
+ extension, define `LOG_COMPILER' as `$(LOG_COMPILE)
+ $(AM_LOG_FLAGS) $(LOG_FLAGS)' and use it as %COMPILE% in check2.
+ * doc/automake.texi (Simple Tests using parallel-tests):
+ Document it. In the examples, suggest using the AM_*LOG_FLAGS
+ flags in Makefile.am rather than the variables without `AM_'
+ prefix.
+ * lib/Automake/tests/Makefile.am (AM_PL_LOG_FLAGS): Renamed from
+ (PL_LOG_FLAGS): ... this variable, intended for the user.
+ * tests/parallel-tests7.test: Extend test.
+ * NEWS: Update.
+ Suggestion by Akim Demaille.
+
More node renaming in the manual.
* doc/automake.texi (Top): Adjust menu to ...
(API Versioning): ... this node being renamed from ...
New in 1.10c:
+
+* Miscellaneous Changes:
+
+ - In 1.10b, the `parallel-tests' driver introduced per-extension test
+ driver variables `<EXT>_LOG_COMPILER', defined as
+
+ $(<EXT>_LOG_COMPILE) $(AM_<EXT>_LOG_FLAGS) $(<EXT>_LOG_FLAGS)
+
+ for extensions `.ext' registered in `TEST_EXTENSIONS'. Now, for tests
+ without a known extension, add `LOG_COMPILER', defined as
+
+ $(LOG_COMPILE) $(AM_LOG_FLAGS) $(LOG_FLAGS)
+
+ to the rules.
+
\f
New in 1.10b:
if substr ($obj, - length ($test_suffix)) eq $test_suffix;
}
$obj .= '.log';
+ my $compile = 'LOG_COMPILE';
+ define_variable ($compile,
+ '$(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS)', INTERNAL);
$output_rules .= file_contents ('check2', new Automake::Location,
GENERIC => 0,
OBJ => $obj,
SOURCE => $val,
- COMPILE => '',
+ COMPILE =>'$(' . $compile . ')',
EXT => '');
return $obj;
});
GENERIC => 1,
OBJ => '',
SOURCE => '$<',
- COMPILE => '$(' . $compile . ')' ,
+ COMPILE => '$(' . $compile . ')',
EXT => $test_suffix);
}
}
@code{TEST_EXTENSIONS} defaults to @file{.test}. Results are undefined
if a test file name ends in several concatenated suffixes.
+@vindex _LOG_COMPILE
@vindex _LOG_COMPILER
@vindex _LOG_FLAGS
+@vindex LOG_COMPILE
+@vindex LOG_COMPILER
+@vindex LOG_FLAGS
@vindex @var{EXT}_LOG_COMPILE
@vindex @var{EXT}_LOG_COMPILER
@vindex @var{EXT}_LOG_FLAGS
@vindex AM_@var{EXT}_LOG_FLAGS
+@vindex AM_LOG_FLAGS
For tests that match an extension @code{.@var{ext}} listed in
@code{TEST_EXTENSIONS}, you can provide a test driver using the variable
@code{@var{ext}_LOG_COMPILER} (note the upper-case extension) and pass
options in @code{AM_@var{ext}_LOG_FLAGS} and allow the user to pass
options in @code{@var{ext}_LOG_FLAGS}. It will cause all tests with
-this extension to be called with this driver. For example,
+this extension to be called with this driver. For all tests without a
+registered extension, the variables @code{LOG_COMPILER},
+@code{AM_LOG_FLAGS}, and @code{LOG_FLAGS} may be used. For example,
@example
-TESTS = foo.pl bar.py
+TESTS = foo.pl bar.py baz
TEST_EXTENSIONS = .pl .py
PL_LOG_COMPILER = $(PERL)
-PL_LOG_FLAGS = -w
+AM_PL_LOG_FLAGS = -w
PY_LOG_COMPILER = $(PYTHON)
-PY_LOG_FLAGS = -v
+AM_PY_LOG_FLAGS = -v
+LOG_COMPILER = ./wrapper-script
+AM_LOG_FLAGS = -d
@end example
@noindent
-will invoke @samp{$(PERL) -w foo.pl} and @samp{$(PYTHON) -v bar.py} to
-produce @file{foo.log} and @file{bar.log}, respectively. The
+will invoke @samp{$(PERL) -w foo.pl}, @samp{$(PYTHON) -v bar.py},
+and @samp{./wrapper-script -d baz} to produce @file{foo.log},
+@file{bar.log}, and @file{baz.log}, respectively. The
@samp{TESTS_ENVIRONMENT} variable is still expanded before the driver,
but should be reserved for the user.
## along with this program. If not, see <http://www.gnu.org/licenses/>.
PL_LOG_COMPILER = $(PERL)
-PL_LOG_FLAGS = -Mstrict -I ../.. -I $(top_srcdir)/lib -w
+AM_PL_LOG_FLAGS = -Mstrict -I ../.. -I $(top_srcdir)/lib -w
TEST_EXTENSIONS = .pl
TESTS = \
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
PL_LOG_COMPILER = $(PERL)
-PL_LOG_FLAGS = -Mstrict -I ../.. -I $(top_srcdir)/lib -w
+AM_PL_LOG_FLAGS = -Mstrict -I ../.. -I $(top_srcdir)/lib -w
TEST_EXTENSIONS = .pl
TESTS = \
Condition.pl \
TEST_EXTENSIONS = .chk .test
CHK_LOG_COMPILER = ./chk-driver
TEST_LOG_COMPILER = ./test-driver
+LOG_COMPILER = ./noext-driver
AM_CHK_LOG_FLAGS = 1
CHK_LOG_FLAGS = 2
AM_TEST_LOG_FLAGS = 3
TEST_LOG_FLAGS = 4
+AM_LOG_FLAGS = 5
+LOG_FLAGS = 6
END
mkdir sub
END
chmod a+x chk-driver
cp chk-driver test-driver
+cp chk-driver noext-driver
cat >foo.chk << 'END'
#! /bin/sh
$MAKE check
grep 'chk-driver *1 *2' foo.log
grep 'test-driver *3 *4' bar.log
-test -f baz.log
-grep driver baz.log && Exit 1
+grep 'noext-driver *5 *6' baz.log
grep 'test-driver *3 *4' bla.log
-test -f bli.suff.log
-grep driver bli.suff.log && Exit 1
-test -f sub/test.log
-grep driver sub/test.log && Exit 1
+grep 'noext-driver *5 *6' bli.suff.log
+grep 'noext-driver *5 *6' sub/test.log
: