[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Automake-commit] [SCM] GNU Automake branch, test-protocols, updated. v1
From: |
Stefano Lattarini |
Subject: |
[Automake-commit] [SCM] GNU Automake branch, test-protocols, updated. v1.11-1107-g1e90abc |
Date: |
Thu, 15 Sep 2011 19:32:33 +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=1e90abcc6da204b8ac0c9b53a5acda75c2b07204
The branch, test-protocols has been updated
via 1e90abcc6da204b8ac0c9b53a5acda75c2b07204 (commit)
from 8cee92bd50e2c5ca47029aec11b35817e30b3bf0 (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 -----------------------------------------------------------------
commit 1e90abcc6da204b8ac0c9b53a5acda75c2b07204
Author: Stefano Lattarini <address@hidden>
Date: Wed Sep 14 14:58:05 2011 +0200
automake: remove code duplication in 'handle_tests'
* automake.in (handle_tests): Factor out some code dealing with
test extensions and rules for generation of `.log' files into ...
(handle_per_suffix_test): ... this new subroutine.
* tests/parallel-tests-exeext.test: New test.
* tests/Makefile.am (TESTS): Update.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 9 ++
automake.in | 115 ++++++++++----------
tests/Makefile.am | 1 +
tests/Makefile.in | 1 +
...est-missing.test => parallel-tests-exeext.test} | 59 +++++------
5 files changed, 97 insertions(+), 88 deletions(-)
copy tests/{test-missing.test => parallel-tests-exeext.test} (51%)
diff --git a/ChangeLog b/ChangeLog
index 11b8bb7..ecde3d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2011-09-15 Stefano Lattarini <address@hidden>
+
+ automake: remove code duplication in 'handle_tests'
+ * automake.in (handle_tests): Factor out some code dealing with
+ test extensions and rules for generation of `.log' files into ...
+ (handle_per_suffix_test): ... this new subroutine.
+ * tests/parallel-tests-exeext.test: New test.
+ * tests/Makefile.am (TESTS): Update.
+
2011-09-11 Stefano Lattarini <address@hidden>
tests: fix spurious failure on fast machines
diff --git a/automake.in b/automake.in
index cbf82e1..677e1fa 100644
--- a/automake.in
+++ b/automake.in
@@ -4793,6 +4793,57 @@ sub handle_tests_dejagnu
$output_rules .= file_contents ('dejagnu', new Automake::Location);
}
+sub handle_per_suffix_test
+{
+ my ($test_suffix, %transform) = @_;
+ my ($pfx, $generic, $parallel_tests_option, $am_exeext);
+ prog_error ("called with 'parallel-tests' option not set")
+ unless $parallel_tests_option = option 'parallel-tests';
+ if ($test_suffix eq '')
+ {
+ $pfx = '';
+ $generic = 0;
+ $am_exeext = 'FALSE';
+ }
+ else
+ {
+ prog_error ("test suffix `$test_suffix' lacks leading dot")
+ unless $test_suffix =~ m/^\.(.*)/;
+ $pfx = uc ($1) . '_';
+ $generic = 1;
+ $am_exeext = exists $configure_vars{'EXEEXT'} ? 'am__EXEEXT'
+ : 'FALSE';
+ }
+ # The "test driver" program, deputed to handle tests protocol used by
+ # test scripts. By default, it's assumed that no protocol is used,
+ # so we fall back to the old "parallel-tests" behaviour, implemented
+ # by the `test-driver' auxiliary script.
+ if (! var "${pfx}LOG_DRIVER")
+ {
+ require_conf_file ($parallel_tests_option->{position}, FOREIGN,
+ 'test-driver');
+ define_variable ("${pfx}LOG_DRIVER",
+ "\$(SHELL) $am_config_aux_dir/test-driver",
+ INTERNAL);
+ }
+ my $driver = '$(' . $pfx . 'LOG_DRIVER)';
+ my $driver_flags = '$(AM_' . $pfx . 'LOG_DRIVER_FLAGS)'
+ . ' $(' . $pfx . 'LOG_DRIVER_FLAGS)';
+ my $compile = "${pfx}LOG_COMPILE";
+ define_variable ($compile,
+ '$(' . $pfx . 'LOG_COMPILER)'
+ . ' $(AM_' . $pfx . 'LOG_FLAGS)'
+ . ' $(' . $pfx . 'LOG_FLAGS)',
+ INTERNAL);
+ $output_rules .= file_contents ('check2', new Automake::Location,
+ GENERIC => $generic,
+ DRIVER => $driver,
+ DRIVER_FLAGS => $driver_flags,
+ COMPILE => '$(' . $compile . ')',
+ EXT => $test_suffix,
+ am__EXEEXT => $am_exeext,
+ %transform);
+}
# Handle TESTS variable and other checks.
sub handle_tests
@@ -4869,33 +4920,10 @@ sub handle_tests
}
my $base = $obj;
$obj .= '.log';
- # The "test driver" program, deputed to handle tests protocol
used by
- # test scripts. By default, it's assumed that no protocol is
used,
- # so we fall back to the old "parallel-tests" behaviour,
implemented
- # by the `test-driver' auxiliary script.
- if (! var 'LOG_DRIVER')
- {
- require_conf_file ($parallel_tests->{position}, FOREIGN,
- 'test-driver');
- define_variable ('LOG_DRIVER',
- "\$(SHELL)
$am_config_aux_dir/test-driver",
- INTERNAL);
- }
- my $driver = '$(LOG_DRIVER)';
- my $driver_flags = '$(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS)';
- 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,
- BASE => $base,
- SOURCE => $val,
- DRIVER => $driver,
- DRIVER_FLAGS => $driver_flags,
- COMPILE =>'$(' . $compile . ')',
- EXT => '',
- am__EXEEXT => 'FALSE');
+ handle_per_suffix_test ('',
+ OBJ => $obj,
+ BASE => $base,
+ SOURCE => $val);
return $obj;
});
@@ -4921,35 +4949,10 @@ sub handle_tests
$nhelper++;
if ($test_suffix ne $at_exeext && $test_suffix ne '')
{
- (my $ext = $test_suffix) =~ s/^\.//;
- $ext = uc $ext;
- # See comments about definition of LOG_DRIVER, above.
- if (! var "${ext}_LOG_DRIVER")
- {
- require_conf_file ($parallel_tests->{position}, FOREIGN,
- 'test-driver');
- define_variable ("${ext}_LOG_DRIVER",
- "\$(SHELL)
$am_config_aux_dir/test-driver",
- INTERNAL);
- }
- my $driver = '$(' . $ext . '_LOG_DRIVER)';
- my $driver_flags = '$(AM_' . $ext . '_LOG_DRIVER_FLAGS) ' .
- '$(' . $ext . '_LOG_DRIVER_FLAGS)';
- my $compile = $ext . '_LOG_COMPILE';
- define_variable ($compile,
- '$(' . $ext . '_LOG_COMPILER) $(AM_' . $ext
. '_LOG_FLAGS)'
- . ' $(' . $ext . '_LOG_FLAGS)', INTERNAL);
- my $am_exeext = $handle_exeext ? 'am__EXEEXT' : 'FALSE';
- $output_rules .= file_contents ('check2', new
Automake::Location,
- GENERIC => 1,
- OBJ => '',
- BASE => '$*',
- SOURCE => '$<',
- DRIVER => $driver,
- DRIVER_FLAGS => $driver_flags,
- COMPILE => '$(' . $compile .
')',
- EXT => $test_suffix,
- am__EXEEXT => $am_exeext);
+ handle_per_suffix_test ($test_suffix,
+ OBJ => '',
+ BASE => '$*',
+ SOURCE => '$<');
}
}
$clean_files{'$(TEST_LOGS)'} = MOSTLY_CLEAN;
diff --git a/tests/Makefile.am b/tests/Makefile.am
index d1164f8..de2c25d 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -721,6 +721,7 @@ parallel-tests9.test \
parallel-tests10.test \
parallel-tests-dry-run.test \
parallel-tests-fd-redirect.test \
+parallel-tests-exeext.test \
parallel-tests-extra-programs.test \
parallel-tests-unreadable.test \
parallel-tests-subdir.test \
diff --git a/tests/Makefile.in b/tests/Makefile.in
index 639356e..bca33ef 100644
--- a/tests/Makefile.in
+++ b/tests/Makefile.in
@@ -980,6 +980,7 @@ parallel-tests9.test \
parallel-tests10.test \
parallel-tests-dry-run.test \
parallel-tests-fd-redirect.test \
+parallel-tests-exeext.test \
parallel-tests-extra-programs.test \
parallel-tests-unreadable.test \
parallel-tests-subdir.test \
diff --git a/tests/test-missing.test b/tests/parallel-tests-exeext.test
similarity index 51%
copy from tests/test-missing.test
copy to tests/parallel-tests-exeext.test
index a4ac179..50de898 100755
--- a/tests/test-missing.test
+++ b/tests/parallel-tests-exeext.test
@@ -15,58 +15,53 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# parallel-tests:
-# - non-existent scripts listed in TESTS get diagnosed
-# See also related test 'test-missing2.test'.
+# - check2.am and interaction with $(EXEEXT)
parallel_tests=yes
. ./defs || Exit 1
cat >> configure.in << 'END'
+dnl We need to fool the init.m4 internals a little.
+AC_DEFUN([_AM_FOO],
+ [m4_provide([_AM_COMPILER_EXEEXT])
+ AC_SUBST([CC], [false])
+ AC_SUBST([EXEEXT])])
+_AM_FOO
AC_OUTPUT
END
cat > Makefile.am << 'END'
-TESTS = ok.test zardoz.test
+TESTS = x y a.test b.test
+LOG_COMPILER = true
TEST_LOG_COMPILER = true
+## We also need to fool the automake internals a little.
+EXTRA_PROGRAMS = y
+y_SOURCES =
END
-: > ok.test
-
$ACLOCAL
$AUTOCONF
$AUTOMAKE -a
-./configure
-
-$MAKE check >output 2>&1 && { cat output; Exit 1; }
-cat output
-test -f ok.log
-grep '^PASS: ok\.test' output
-$FGREP 'zardoz.log' output
-test ! -f test-suite.log
+$EGREP 'EXEEXT|\.log|\.test' Makefile.in # For debugging.
-TESTS='zardoz2.test' $MAKE -e check >output 2>&1 \
- && { cat output; Exit 1; }
-cat output
-$FGREP 'zardoz2.log' output
-test ! -f test-suite.log
-
-TEST_LOGS='zardoz3.log' $MAKE -e check >output 2>&1 \
- && { cat output; Exit 1; }
-cat output
-$FGREP 'zardoz3.log' output
-test ! -f test-suite.log
+./configure EXEEXT=
+touch x y a.test b.test
+$MAKE check
-# The errors should persist even after `test-suite.log'
-# has been created.
+$MAKE distclean
+rm -f x y a.test b.test *.log *.trs
-: > zardoz.test
+./configure EXEEXT=.bin
+touch x y.bin a.test b.test.bin
$MAKE check
-rm -f zardoz.test
+ls -l # For debugging.
+test -f y.log
+test ! -r y.bin.log
+test -f b.log
+test ! -r b.test.log
-$MAKE check >output 2>&1 && { cat output; Exit 1; }
-cat output
-$FGREP 'zardoz.log' output
-test ! -f test-suite.log
+$EGREP '^y\.log: y(\$\(EXEEXT\)|\.bin)' Makefile
+$EGREP '^\.test(\$\(EXEEXT\)|\.bin)\.log:' Makefile
:
hooks/post-receive
--
GNU Automake
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Automake-commit] [SCM] GNU Automake branch, test-protocols, updated. v1.11-1107-g1e90abc,
Stefano Lattarini <=