]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
[ng] parallel-tests: reduce code duplication a little
authorStefano Lattarini <stefano.lattarini@gmail.com>
Sun, 15 Apr 2012 15:27:58 +0000 (17:27 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 16 Apr 2012 20:37:46 +0000 (22:37 +0200)
Use more GNU make features and built-ins, and less automake-time
pre-processing, in order to reduce code duplication and improve
clarity.

* lib/am/check2.am: Define a new custom make function 'am__runtest', used
to simplify rules in here, and reduce code duplication among them.
* automake.in (handle_per_suffix_test): Update and simplify accordingly.
As a result, the automake-defined 'LOG_COMPILE' variables are not defined
anymore, which we should mention ...
* NG-NEWS: ... in here.
* t/test-extensions.sh: Adjust outdated grepping checks.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
NG-NEWS
automake.in
lib/am/check2.am
t/test-extensions.sh

diff --git a/NG-NEWS b/NG-NEWS
index ab7ee2e1f9674cd204a36cc861e099c1c0205f85..6da558e37c782504c413de67535501ab085a394b 100644 (file)
--- a/NG-NEWS
+++ b/NG-NEWS
@@ -59,6 +59,13 @@ Warnings and diagnostic
 * The 'portability-recursive' warning category is obsolete, and has been
   removed.
 
+Parallel testsuite harness
+==========================
+
+* Automake does not automatically generate the definition of 'LOG_COMPILE'
+  variables anymore.  These have always been meant for internal use only
+  anyway.
+
 Miscellaneous
 =============
 
index 820285b487671c992ccfa1db70624328cc4a4c3b..bb475286cf99ea005a48a29f77961598b1548c2e 100644 (file)
@@ -4743,20 +4743,9 @@ sub handle_per_suffix_test
                        "\$(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 . ')',
+                                   PFX => $pfx,
                                    EXT => $test_suffix,
                                    am__EXEEXT => $am_exeext,
                                    %transform);
index a14e775cde70485a18d1f7ae380b3c98c963b139..112a7b64819af9f559dc7b7ef09c970e5f1e2249 100644 (file)
 ## You should have received a copy of the GNU General Public License
 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+if %?FIRST%
+am__runtest = \
+  p=$<; $(am__check_pre) \
+  $($(1)LOG_DRIVER) \
+  --test-name "$$f" \
+  --log-file $(2).log \
+  --trs-file $(2).trs \
+  $(am__common_driver_flags) \
+  $(AM_$(1)LOG_DRIVER_FLAGS) \
+  $($(1)LOG_DRIVER_FLAGS) \
+  -- \
+  $($(1)LOG_COMPILER) \
+  $(AM_$(1)LOG_FLAGS) \
+  $($(1)LOG_FLAGS) \
+  "$$tst" \
+  $(AM_TESTS_FD_REDIRECT)
+endif %?FIRST%
+
 ## From a test file to a .log and .trs file.
 ?GENERIC?%EXT%.log:
 ?!GENERIC?%OBJ%: %SOURCE%
-       @p='%SOURCE%'; $(am__check_pre) %DRIVER% --test-name "$$f" \
-       --log-file '%BASE%.log' --trs-file '%BASE%.trs' \
-       $(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \
-       "$$tst" $(AM_TESTS_FD_REDIRECT)
+       @$(call am__runtest,%PFX%,%BASE%)
 
 ## If no programs are built in this package, then this rule is removed
 ## at automake time.  Otherwise, %am__EXEEXT% expands to a configure time
@@ -28,8 +43,5 @@
 ## conflict with the previous one.
 if %am__EXEEXT%
 ?GENERIC?%EXT%$(EXEEXT).log:
-       @p='%SOURCE%'; $(am__check_pre) %DRIVER% --test-name "$$f" \
-       --log-file '%BASE%.log' --trs-file '%BASE%.trs' \
-       $(am__common_driver_flags) %DRIVER_FLAGS% -- %COMPILE% \
-       "$$tst" $(AM_TESTS_FD_REDIRECT)
+       @$(call am__runtest,%PFX%,%BASE%)
 endif %am__EXEEXT%
index d2fc2dd06b528538bbc5706e8db7e2a039b687bb..c903798f022c5b74fc8b588e580940a4c01f67e1 100755 (executable)
@@ -41,8 +41,7 @@ grep -i 'log' Makefile.in # For debugging.
 
 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
+  grep "^${uc}_LOG_DRIVER =" Makefile.in
   grep "^\.${lc}\.log:" Makefile.in
 done