]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
Merge branch 'master' into test-protocols
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 6 Oct 2011 20:09:30 +0000 (22:09 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 6 Oct 2011 20:09:30 +0000 (22:09 +0200)
1  2 
ChangeLog
automake.in
tests/test-extensions.test

diff --cc ChangeLog
index 46921923b2cf65abe48528a89f78e325f96f9c77,8f200e402e7e399a92d53ad2eac7ae5aee245f9e..977275e27c7ff5ffb4fc0ad882d74cf392740851
+++ b/ChangeLog
@@@ -1,11 -1,37 +1,45 @@@
+ 2011-10-06  Stefano Lattarini  <stefano.lattarini@gmail.com>
+       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  <stefano.lattarini@gmail.com>
+       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  <stefano.lattarini@gmail.com>
+       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  <stefano.lattarini@gmail.com>
 +
 +      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  <stefano.lattarini@gmail.com>
  
        fix: make a test script executable
diff --cc automake.in
index d9caa6ef497cd7c9eebe7a49bdb7aba1e916c1dc,b69884a972fd0adc30123b9d42989a67e839ad82..718b32860c73db292cf473607b46937b9eb838c8
@@@ -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
  {
index c216d120d8f62f7edd85aca873d4bb2766288bbf,901d872bc6a62e3b493b286532d2ec133bbdf3dd..60b708528f6ad63490c59913b3b0060cd08d19df
@@@ -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