From: Stefano Lattarini Date: Thu, 6 Oct 2011 20:09:30 +0000 (+0200) Subject: Merge branch 'master' into test-protocols X-Git-Tag: ng-0.5a~89^2~29^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80795e05596fa50c395979bf0238d69709297f71;p=thirdparty%2Fautomake.git Merge branch 'master' into test-protocols --- 80795e05596fa50c395979bf0238d69709297f71 diff --cc ChangeLog index 46921923b,8f200e402..977275e27 --- a/ChangeLog +++ b/ChangeLog @@@ -1,11 -1,37 +1,45 @@@ + 2011-10-06 Stefano Lattarini + + parallel-tests: don't allow @substitutions@ in TEST_EXTENSIONS + Even after the last commit `v1.11-476-g90bea64', the checks + performed by automake on entries in $(TEST_EXTENSIONS) tried to + allow for @substitited@ stuff. This however ends up allowing + quite brittle setups, which, most importantly, are of no real + practical usefulness anyway. So it's better to just disallow + @substitutions@ in TEST_EXTENSIONS altogether, offering a clear + error message, instead of risking weird bugs and unexpected + behaviors in the generated Makefile.in. + * automake.in ($TEST_EXTENSION_PATTERN): Turned from a regular + expression ... + (is_valid_test_extension): ... into this subroutine. Don't allow + generic @substitutions@ anymore (possibly making an exception for + `@EXEEXT@' under the proper circumstances). + * tests/test-extensions.test: Adjust and extend. + + 2011-10-06 Stefano Lattarini + + tests: fix spurious failure in 'insthook.test' + * tests/insthook.test (Makefile.am): Add a proper `uninstall-hook' + target to remove the symlink created by the `install-exec-hook' + target; this prevents "make distcheck" from failing spuriously. + Since we are at it, delete an extra blank line, and add a trailing + `:' command. + + 2011-10-06 Stefano Lattarini + + maintcheck: fix spurious failure + * lib/am/distdir.am: Use `$(infodir)', not `${infodir}', to avoid + complaints from the `sc_no_brace_variable_expansions' maintainer + check. + +2011-10-06 Stefano Lattarini + + tests: fix spurious error in 'test-extensions.test' + * tests/test-extensions.test: Call automake with the option + `--add-missing', to ensure the required script `test-driver' + gets installed. Note that the test still fails due to an + internal error in automake, though. + 2011-10-06 Stefano Lattarini fix: make a test script executable diff --cc automake.in index d9caa6ef4,b69884a97..718b32860 --- a/automake.in +++ b/automake.in @@@ -4795,58 -4793,20 +4793,72 @@@ sub handle_tests_dejagn $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); +} + + # is_valid_test_extension ($EXT) + # ------------------------------ + # Return true if $EXT can appear in $(TEST_EXTENSIONS), return false + # otherwise. + sub is_valid_test_extension ($) + { + my $ext = shift; + return 1 + if ($ext =~ /^\.[a-zA-Z_][a-zA-Z0-9_]*$/); + return 1 + if (exists $configure_vars{'EXEEXT'} && $ext eq subst ('EXEEXT')); + return 0; + } + # Handle TESTS variable and other checks. sub handle_tests { diff --cc tests/test-extensions.test index c216d120d,901d872bc..60b708528 --- a/tests/test-extensions.test +++ b/tests/test-extensions.test @@@ -31,16 -30,18 +30,18 @@@ EN $ACLOCAL $AUTOCONF - cat > Makefile.am << 'END' - TESTS = - TEST_EXTENSIONS = .sh .T .t1 ._foo .BAR .x_Y_z ._ @ext@ - END + valid_extensions='sh T t1 _foo BAR x_Y_z _' + + echo TESTS = > Makefile.am + echo " $valid_extensions" \ + | sed -e 's/ / ./g' -e 's/^/TEST_EXTENSIONS =/' >> Makefile.am + cat Makefile.am # For debugging. -$AUTOMAKE +$AUTOMAKE -a - $EGREP -i 'log|ext' Makefile.in # For debugging. + grep -i 'log' Makefile.in # For debugging. - for lc in sh T t1 _foo BAR x_Y_z _; do + for lc in $valid_extensions; do uc=`echo $lc | tr '[a-z]' '[A-Z]'` $FGREP "\$(${uc}_LOG_COMPILER)" Makefile.in grep "^${uc}_LOG_COMPILE =" Makefile.in