Bogdan <bogdro_...@gmx.us>, Tue Apr 04 2023 21:51:52 GMT+0200 (Central European Summer Time)
Karl Berry <k...@freefriends.org>, Mon Apr 03 2023 02:08:22 GMT+0200 (Central European Summer Time)
     # A trick to make the test run muuuch faster, by avoiding repeated
     # runs of aclocal (one order of magnitude improvement in speed!).
     echo 'AC_INIT(x,0) AM_INIT_AUTOMAKE' > configure.ac

Hadn't noticed this before. Maybe you could see what tests are currently
taking the longest to run, and see if the above helps speed them up?


 Sure, when I eventually find the time to run 'time' :). I was hoping to have some results by now, hence the delay.  Is there a way to time individual tests, or do I have to run 'time make check TESTS=...'?


It seems a somewhat weird thing to do, but if it saves enough time, I
guess it would be worth it. --thanks, karl.


 Yes, it is a bit weird and I don't know if this can negatively impact the tests themselves in functionalities which may rely on aclocal.m4 to be correct. Certainly the tests that add or remove macro calls to or from configure.ac need to have aclocal.m4 up-to-date and so they need to run aclocal after each modification, as I see it.


 Coming back to the subject: I chose tests which:

- run 'aclocal' in a loop (assuming it is indented):
        egrep '^[ \t]+\$ACLOCAL' t/*sh

- run 'aclocal' without arguments more than once:
        grep -c '\$ACLOCAL[ \t]*$' t/*.sh | /bin/grep -v ':[01]$'

Then, I analysed the files and added the trick from t/backcompat2.sh (if possible) and/or removed the extra calls to $ACLOCAL (if possible).

Results of the analysis or gain in time:

t/aclocal-path-install-serial.sh: cannot change here, aclocal is under test

t/backcompat-acout.sh: 35 -> 24s

t/deprecated-acinit.sh: cannot change here, aclocal is under test

t/dist-auxdir-many-subdirs.sh: 1:23 -> 1:18

t/dist-auxfile.sh: 16 -> 15s

t/dist-no-built-sources.sh: 8s, cannot change here (uses current configure.ac)

t/suffix.sh: 8s, cannot change here (uses current configure.ac)

t/test-driver-is-distributed.sh: 16 -> 15s

t/am-prog-cc-c-o.sh: 17 -> 15s, cannot change here (uses current configure.ac)

t/ar-lib3.sh: cannot change here (uses current configure.ac)

t/ar-lib4.sh: cannot change here (uses current configure.ac)

t/asm2.sh: 14 -> 12s

t/asm3.sh: 14 -> 12s

t/asm.sh: 12 -> 10s

t/backcompat3.sh: 12 -> 10s

t/conffile-leading-dot.sh: 10 -> 9s

t/confh.sh: 9 -> 8s

t/copy.sh: cannot change here (uses current configure.ac)

t/dir-named-obj-is-bad.sh: cannot change here (uses current configure.ac)

t/distcheck-configure-flags-subpkg.sh: 10 -> 9s

t/distcheck-hook2.sh: 9.8 -> 9.2s

t/dist-shar.sh: 8 -> 7-8s

t/dist-tarZ.sh: skipped

t/fn99subdir.sh: 12 -> 11s

t/fort2.sh: 8-9 -> 7.5s

t/libobj16a.sh: 29-34 -> 28s

t/libobj16b.sh: 29 -> 28s

t/libobj19.sh: 22 -> 21s

t/libobj-basic.sh: 20 -> 20s

t/lisp2.sh: 9 -> 7s

t/nodef2.sh: 6 -> 5s

t/nodef.sh: 5 -> 4s

t/objc-basic.sh: cannot change here (changes configure.ac afterwards)

t/objcxx-basic.sh: cannot change here (changes configure.ac afterwards)

t/pr401b.sh: 1:42-43 -> 1:38

t/pr401c.sh: 50 -> 48s

t/pr401.sh: 41 -> 38s

t/serial-tests.sh: 6 -> 5s

t/silent-configsite.sh: cannot change here (changes configure.ac afterwards)

t/strictness-precedence.sh: 12 -> 9s

t/subobj6.sh: 10-13 -> 10s

t/subpkg2.sh: cannot change here, aclocal is under test

t/subpkg3.sh: cannot change here, aclocal may be under test

t/subpkg4.sh: cannot change here, aclocal may be under test

t/subpkg.sh: cannot change here, aclocal is under test

t/subpkg-yacc.sh: cannot change here, aclocal may be under test

t/vala-configure.sh: 22 -> 21s

t/vala-non-recursive-setup.sh: skipped

t/warning-groups-win-over-strictness.sh: 7 -> 5s

t/warnings-precedence.sh: 11-12 -> 9s

t/warnings-strictness-interactions.sh: 4-5 -> 4s

t/warnopts.sh: 5 -> 4s

Short version: after a few hours of testing and modifications, I *may* have saved up to 1 minute and 12 seconds of testing...

You may look at the attached patch as a result of the investigation and then ... you're free to completely ignore it :). It works for me, but I wonder if it won't cause more confusion than it's worth...

Funny thing - removing $ACLOCAL from t/backcompat.sh actually makes it run much SLOWER - from 30s to 55s. No idea why.

Other conclusions:

- having 1277 .sh files in 't/' means that even if each runs in 30 seconds, you have 10 hours of testing just from the number of tests,

- it may be better to determine if there are duplicate tests (but with different names, circumstances, etc.) and eliminate those or merge tests which are "close enough" each other (like one being just another test case for the other) - this may be a significant gain,

- as you see above, t/pr401b.sh takes 1m42s to run. I wonder if e.g. running the 'distcheck' target in tests would be the main factor of the running time. Seems to do a bit of work - reconfigure, package, run tests, install, uninstall, verify, ... Same case for t/pr401c.sh and t/pr401.sh, although shorter times. Sure, it *is* needed sometimes, but maybe a thing worth looking at if it's needed everywhere it's used. Or leave it, just in case, or make the target actually run faster...

--
Regards - Bogdan ('bogdro') D.                 (GNU/Linux & FreeDOS)
X86 assembly (DOS, GNU/Linux):    http://bogdro.evai.pl/index-en.php
Soft(EN): http://bogdro.evai.pl/soft  http://bogdro.evai.pl/soft4asm
www.Xiph.org  www.TorProject.org  www.LibreOffice.org  www.GnuPG.org
From b7930d451723b63e6ceec1e7b9675fe9a54efeb0 Mon Sep 17 00:00:00 2001
From: Bogdan Drozdowski <>
Date: Sun, 9 Apr 2023 20:30:07 +0200
Subject: [PATCH] Skip aclocal to speedup some tests

---
 t/am-prog-cc-c-o.sh                     |  8 ++++++--
 t/asm.sh                                |  6 ++++--
 t/asm2.sh                               |  9 ++++++---
 t/asm3.sh                               |  9 ++++++---
 t/backcompat-acout.sh                   | 19 +++++++++++++++----
 t/backcompat3.sh                        |  8 ++++++--
 t/conffile-leading-dot.sh               |  4 +++-
 t/confh.sh                              |  3 ++-
 t/dist-auxdir-many-subdirs.sh           | 19 ++++++++++++++++++-
 t/dist-auxfile.sh                       | 13 ++++++++++++-
 t/dist-shar.sh                          |  4 +++-
 t/distcheck-configure-flags-subpkg.sh   |  4 +++-
 t/distcheck-hook2.sh                    |  4 +++-
 t/fn99subdir.sh                         |  5 ++++-
 t/fort2.sh                              |  4 +++-
 t/libobj16a.sh                          |  4 +++-
 t/libobj16b.sh                          |  4 +++-
 t/libobj19.sh                           |  6 ++++--
 t/lisp2.sh                              |  9 ++++++---
 t/nodef.sh                              |  3 ++-
 t/nodef2.sh                             |  3 ++-
 t/pr401.sh                              | 12 +++++++++---
 t/pr401b.sh                             | 12 +++++++++---
 t/pr401c.sh                             | 12 +++++++++---
 t/serial-tests.sh                       |  4 +++-
 t/strictness-precedence.sh              |  9 ++++++---
 t/subobj6.sh                            |  3 ++-
 t/test-driver-is-distributed.sh         | 13 ++++++++++++-
 t/vala-configure.sh                     |  4 +++-
 t/warning-groups-win-over-strictness.sh |  6 ++++--
 t/warnings-precedence.sh                |  9 ++++++---
 t/warnings-strictness-interactions.sh   |  3 ++-
 t/warnopts.sh                           |  3 ++-
 33 files changed, 181 insertions(+), 57 deletions(-)

diff --git a/t/am-prog-cc-c-o.sh b/t/am-prog-cc-c-o.sh
index 8fe439e0e..fb85336d4 100644
--- a/t/am-prog-cc-c-o.sh
+++ b/t/am-prog-cc-c-o.sh
@@ -81,7 +81,9 @@ AC_PROG_CC
 AM_TWEAKED_OUTPUT
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE --add-missing
 
@@ -109,7 +111,9 @@ AM_PROG_CC_C_O
 AM_TWEAKED_OUTPUT
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE --add-missing
 
diff --git a/t/asm.sh b/t/asm.sh
index 0ea299bb2..3f0264866 100644
--- a/t/asm.sh
+++ b/t/asm.sh
@@ -67,7 +67,8 @@ AC_PROG_CC
 AC_OUTPUT
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 AUTOMAKE_fails
 grep '[Aa]ssembler source.*CCASFLAGS.* undefined' stderr
 grep 'define .*CCASFLAGS.* add .*AM_PROG_AS' stderr
@@ -83,7 +84,8 @@ AC_SUBST([CCASFLAGS])
 AC_OUTPUT
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 $AUTOMAKE
 
 rm -rf autom4te*.cache
diff --git a/t/asm2.sh b/t/asm2.sh
index 39820670d..7cdf6e4e3 100644
--- a/t/asm2.sh
+++ b/t/asm2.sh
@@ -67,7 +67,8 @@ AC_PROG_CC
 AC_OUTPUT
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 AUTOMAKE_fails
 grep '[Aa]ssembler source.*CCASFLAGS.* undefined' stderr
 grep 'define .*CCASFLAGS.* add .*AM_PROG_AS' stderr
@@ -83,7 +84,8 @@ AC_SUBST([CCASFLAGS])
 AC_OUTPUT
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 AUTOMAKE_fails
 grep ' add .*AM_PROG_AS' stderr
 
@@ -99,7 +101,8 @@ AC_SUBST([CCASFLAGS])
 AC_OUTPUT
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 $AUTOMAKE
 
 rm -rf autom4te*.cache
diff --git a/t/asm3.sh b/t/asm3.sh
index 63c052aa1..846943287 100644
--- a/t/asm3.sh
+++ b/t/asm3.sh
@@ -67,7 +67,8 @@ AC_PROG_CC
 AC_OUTPUT
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 AUTOMAKE_fails
 grep '[Aa]ssembler source.*CCASFLAGS.* undefined' stderr
 grep 'define .*CCASFLAGS.* add .*AM_PROG_AS' stderr
@@ -83,7 +84,8 @@ AC_SUBST([CCASFLAGS])
 AC_OUTPUT
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 AUTOMAKE_fails
 grep ' add .*AM_PROG_AS' stderr
 
@@ -99,7 +101,8 @@ AC_SUBST([CCASFLAGS])
 AC_OUTPUT
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 $AUTOMAKE
 
 rm -rf autom4te*.cache
diff --git a/t/backcompat-acout.sh b/t/backcompat-acout.sh
index 03ffd8307..fbfae9968 100644
--- a/t/backcompat-acout.sh
+++ b/t/backcompat-acout.sh
@@ -29,6 +29,15 @@ mkdir sub
 
 ls -l # For debugging.
 
+# For performance - run aclocal just once
+# (but call all the marcos that may be used later):
+unindent > configure.ac << END
+    AC_INIT([$me], [0])
+    AM_INIT_AUTOMAKE
+END
+$ACLOCAL
+rm -rf configure.ac autom4te.*
+
 for args in \
   'foo' \
   'foo:foo1.in' \
@@ -39,7 +48,7 @@ for args in \
   'foo:foo1.in:foo2.in:foo3.in' \
   'foo:foo1.in:foo2.in:sub/bar.in:foo3.in' \
 ; do
-  rm -rf autom4te*.cache aclocal.m4
+  rm -rf autom4te*.cache
   unindent >configure.ac <<END
     AC_INIT([$me], [1.0])
     AM_INIT_AUTOMAKE
@@ -47,17 +56,19 @@ for args in \
     AC_OUTPUT
 END
   cat configure.ac # For debugging.
-  $ACLOCAL
+  # Save time:
+  #$ACLOCAL
   $AUTOMAKE Makefile
   mv -f Makefile.in Makefile.acf
-  rm -rf autom4te*.cache aclocal.m4
+  rm -rf autom4te*.cache
   unindent >configure.ac <<END
     AC_INIT([$me], [1.0])
     AM_INIT_AUTOMAKE
     AC_OUTPUT([$args])
 END
   cat configure.ac # For debugging.
-  $ACLOCAL
+  # Save time:
+  #$ACLOCAL
   $AUTOMAKE Makefile
   mv -f Makefile.in Makefile.aco
   diff Makefile.acf Makefile.aco
diff --git a/t/backcompat3.sh b/t/backcompat3.sh
index 7ab134412..235f401f1 100644
--- a/t/backcompat3.sh
+++ b/t/backcompat3.sh
@@ -85,7 +85,9 @@ END
 
 cat configure.ac
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE
 
@@ -118,7 +120,9 @@ END
 
 cat configure.ac
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE
 
diff --git a/t/conffile-leading-dot.sh b/t/conffile-leading-dot.sh
index 26cb9ec45..1dbd5b2a3 100644
--- a/t/conffile-leading-dot.sh
+++ b/t/conffile-leading-dot.sh
@@ -45,7 +45,9 @@ grep "^configure\.ac:4:.*remake rules might be subtly broken" stderr
 sed 's/^AM_INIT_AUTOMAKE/&([-Wall -Wno-unsupported])/' <configure.ac >t
 mv -f t configure.ac
 rm -rf autom4te*.cache
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE -Wall -Wno-unsupported
 ./configure
diff --git a/t/confh.sh b/t/confh.sh
index ac20d8c89..91ce22ece 100644
--- a/t/confh.sh
+++ b/t/confh.sh
@@ -56,7 +56,8 @@ $MAKE distcheck
 # Make sure re-running automake in a different way generates same
 # Makefile.in.
 mv Makefile.in Makefile.sav
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 $AUTOMAKE Makefile
 diff Makefile.sav Makefile.in
 
diff --git a/t/dist-auxdir-many-subdirs.sh b/t/dist-auxdir-many-subdirs.sh
index 869241242..0c1a549cc 100644
--- a/t/dist-auxdir-many-subdirs.sh
+++ b/t/dist-auxdir-many-subdirs.sh
@@ -24,6 +24,21 @@ required=cc
 count=0
 ocwd=$(pwd) || fatal_ "cannot get current working directory"
 
+# For performance - run aclocal just once
+# (but call all the marcos that may be used later):
+unindent > configure.ac << END
+    AC_INIT([$me], [0])
+    AM_INIT_AUTOMAKE
+    AC_PROG_CC
+    # We don't want to require python or emcas in this test, so
+    # the tricks below.
+    AM_PATH_PYTHON([2.2], [], [:])
+    EMACS=no; AM_PATH_LISPDIR
+    AC_CONFIG_FILES([Makefile])
+END
+$ACLOCAL
+rm -rf configure.ac autom4te.*
+
 # Usage: do_check [--add-missing] [CONFIG-AUXDIR-PATH=.]
 do_check ()
 {
@@ -83,7 +98,9 @@ END
   done
   echo AC_OUTPUT >> configure.ac
 
-  $ACLOCAL
+  # Save time:
+  #$ACLOCAL
+  cp ../aclocal.m4 .
   $AUTOCONF
 
   "$am_scriptdir"/install-sh -d $auxdir \
diff --git a/t/dist-auxfile.sh b/t/dist-auxfile.sh
index 842adaa0a..5b5021a43 100644
--- a/t/dist-auxfile.sh
+++ b/t/dist-auxfile.sh
@@ -22,6 +22,15 @@
 am_create_testdir=empty
 . test-init.sh
 
+# For performance - run aclocal just once
+# (but call all the marcos that may be used later):
+unindent > configure.ac <<END
+    AC_INIT([$me], [1.0])
+    AM_INIT_AUTOMAKE
+END
+$ACLOCAL
+rm -rf configure.ac autom4te.*
+
 i=0
 for auxdir in build-aux ''; do
 
@@ -70,7 +79,9 @@ END
     auxdir_rx=$auxdir
   fi
 
-  $ACLOCAL
+  # Save time:
+  #$ACLOCAL
+  cp ../aclocal.m4 .
   $AUTOCONF
 
   AUTOMAKE_fails
diff --git a/t/dist-shar.sh b/t/dist-shar.sh
index 95bce63e5..a088f0672 100644
--- a/t/dist-shar.sh
+++ b/t/dist-shar.sh
@@ -35,7 +35,9 @@ END
 : > Makefile.am
 
 rm -rf autom4te*.cache
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 AUTOMAKE_run -Wno-error
 grep "^configure\\.ac:2:.*$errmsg" stderr
 
diff --git a/t/distcheck-configure-flags-subpkg.sh b/t/distcheck-configure-flags-subpkg.sh
index 89a8061fe..4b92db637 100644
--- a/t/distcheck-configure-flags-subpkg.sh
+++ b/t/distcheck-configure-flags-subpkg.sh
@@ -53,7 +53,9 @@ $AUTOMAKE
 $AUTOCONF
 
 cd subpkg
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+cp ../aclocal.m4 .
 $AUTOMAKE
 $AUTOCONF
 cd ..
diff --git a/t/distcheck-hook2.sh b/t/distcheck-hook2.sh
index 44945deb6..8e36ebef2 100644
--- a/t/distcheck-hook2.sh
+++ b/t/distcheck-hook2.sh
@@ -55,7 +55,9 @@ $ACLOCAL
 $AUTOMAKE
 $AUTOCONF
 cd subpkg
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+cp ../aclocal.m4 .
 $AUTOMAKE
 $AUTOCONF
 cd ..
diff --git a/t/fn99subdir.sh b/t/fn99subdir.sh
index 75db86d88..633a32ea2 100644
--- a/t/fn99subdir.sh
+++ b/t/fn99subdir.sh
@@ -59,9 +59,12 @@ cd $subdirname
 $ACLOCAL
 $AUTOCONF
 $AUTOMAKE
+# Save time:
+cp aclocal.m4 ..
 cd ..
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 $AUTOCONF
 $AUTOMAKE
 
diff --git a/t/fort2.sh b/t/fort2.sh
index b0e4c5313..ddb5922e2 100644
--- a/t/fort2.sh
+++ b/t/fort2.sh
@@ -57,7 +57,9 @@ sed '/^AC_FC_SRCEXT.*blabla/d' configure.ac >t
 mv -f t configure.ac
 
 rm -rf autom4te*.cache
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOMAKE
 $AUTOCONF
 
diff --git a/t/libobj16a.sh b/t/libobj16a.sh
index 0a8e058b8..ed9f081b5 100644
--- a/t/libobj16a.sh
+++ b/t/libobj16a.sh
@@ -120,7 +120,9 @@ AC_LIBSOURCES([maude.c, liver.c])
 }' configure.proto > configure.ac
 cat configure.ac # For debugging.
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE
 
diff --git a/t/libobj16b.sh b/t/libobj16b.sh
index 5582ebab8..37296b53e 100644
--- a/t/libobj16b.sh
+++ b/t/libobj16b.sh
@@ -121,7 +121,9 @@ AC_LIBSOURCE(liver.c) dnl: do not quote this!
 }' configure.proto > configure.ac
 cat configure.ac # For debugging.
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE
 
diff --git a/t/libobj19.sh b/t/libobj19.sh
index 965ea188d..6d60b5467 100644
--- a/t/libobj19.sh
+++ b/t/libobj19.sh
@@ -69,7 +69,7 @@ $MAKE distcheck
 # the top-level one.
 
 $MAKE distclean
-rm -rf autom4te*.cache aclocal.m4 configure
+rm -rf autom4te*.cache configure
 
 mkdir sub
 mv -f Makefile.am sub
@@ -81,7 +81,9 @@ AC_CONFIG_FILES([sub/Makefile])
 mv -f t configure.ac
 cat configure.ac # For debugging.
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE
 
diff --git a/t/lisp2.sh b/t/lisp2.sh
index 6964a1626..7411d06a7 100644
--- a/t/lisp2.sh
+++ b/t/lisp2.sh
@@ -40,7 +40,8 @@ lispdir = /usr/share/emacs/site-lisp
 lisp_LISP = foo.el
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 AUTOMAKE_fails
 grep 'lispdir.*undefined' stderr && exit 1
 grep '[Ll]isp source.*EMACS.* undefined' stderr
@@ -54,7 +55,8 @@ EMACS = emacs
 lisp_LISP = foo.el
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 AUTOMAKE_fails
 grep 'EMACS.*undefined' stderr && exit 1
 grep '[Ll]isp source.*lispdir.* undefined' stderr
@@ -69,7 +71,8 @@ EMACS = emacs
 lisp_LISP = foo.el
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 $AUTOMAKE -a
 
 :
diff --git a/t/nodef.sh b/t/nodef.sh
index 280e08572..aa1d99f57 100644
--- a/t/nodef.sh
+++ b/t/nodef.sh
@@ -49,7 +49,8 @@ AM_INIT_AUTOMAKE([UnIqUe_PaCkAgE], [UnIqUe_VeRsIoN], [no])
 AC_OUTPUT(output)
 END
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 $AUTOCONF
 ./configure
 
diff --git a/t/nodef2.sh b/t/nodef2.sh
index 3b8d8f214..8fc5c9b95 100644
--- a/t/nodef2.sh
+++ b/t/nodef2.sh
@@ -44,7 +44,8 @@ END
 
 : > Makefile.am
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 $AUTOCONF
 $AUTOMAKE # Dummy call to make sure Automake grok 'no-define' silently.
 ./configure
diff --git a/t/pr401.sh b/t/pr401.sh
index 4a0fc8a12..457442909 100644
--- a/t/pr401.sh
+++ b/t/pr401.sh
@@ -95,7 +95,9 @@ $MAKE distcheck
 sed 's/#: //' configure.ac >configure.tmp
 mv -f configure.tmp configure.ac
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE
 ./configure
@@ -139,7 +141,9 @@ TESTS = main
 endif
 EOF
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE --add-missing
 ./configure
@@ -178,7 +182,9 @@ check-local:
 	test ! -f src/$(DEPDIR)/feep.Po
 EOF
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE
 ./configure
diff --git a/t/pr401b.sh b/t/pr401b.sh
index ead8708ec..58b251da7 100644
--- a/t/pr401b.sh
+++ b/t/pr401b.sh
@@ -96,7 +96,9 @@ $MAKE distcheck
 sed 's/#: //' configure.ac >configure.tmp
 mv -f configure.tmp configure.ac
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE -a
 ./configure
@@ -139,7 +141,9 @@ TESTS = main
 endif
 EOF
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE --add-missing
 ./configure
@@ -178,7 +182,9 @@ check-local:
 	test ! -f src/$(DEPDIR)/feep.Po
 EOF
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE
 ./configure
diff --git a/t/pr401c.sh b/t/pr401c.sh
index 56320294d..7d9455929 100644
--- a/t/pr401c.sh
+++ b/t/pr401c.sh
@@ -97,7 +97,9 @@ $MAKE distcheck
 sed 's/#: //' configure.ac >configure.tmp
 mv -f configure.tmp configure.ac
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE
 ./configure
@@ -141,7 +143,9 @@ TESTS = main
 endif
 EOF
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE --add-missing
 ./configure
@@ -180,7 +184,9 @@ check-local:
 	test ! -f src/$(DEPDIR)/alloca.Po
 EOF
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 $AUTOMAKE
 ./configure
diff --git a/t/serial-tests.sh b/t/serial-tests.sh
index 4c3b67ceb..87bb19eef 100644
--- a/t/serial-tests.sh
+++ b/t/serial-tests.sh
@@ -67,7 +67,9 @@ cd ..
 
 cd two
 mkdir config
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+cp ../one/aclocal.m4 .
 $AUTOMAKE --add-missing
 grep TEST [ab]Makefile.in # For debugging.
 has_parallel_tests aMakefile.in
diff --git a/t/strictness-precedence.sh b/t/strictness-precedence.sh
index 9f270f906..5535054b5 100644
--- a/t/strictness-precedence.sh
+++ b/t/strictness-precedence.sh
@@ -59,16 +59,19 @@ ok --gnu --foreign
 set_strictness '' Makefile.am
 set_strictness 'gnu foreign' configure.ac
 rm -rf autom4te*.cache
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 ok
 set_strictness 'foreign gnu' configure.ac
 rm -rf autom4te*.cache
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 ko
 
 set_strictness '' configure.ac
 rm -rf autom4te*.cache
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 set_strictness 'gnu foreign' Makefile.am
 ok
 set_strictness 'foreign gnu' Makefile.am
diff --git a/t/subobj6.sh b/t/subobj6.sh
index 21e44d4b9..9e5b0a9d0 100644
--- a/t/subobj6.sh
+++ b/t/subobj6.sh
@@ -71,7 +71,8 @@ END
 
 mv generic/a.c a.c
 
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 $AUTOCONF
 $AUTOMAKE --include-deps --copy --add-missing
 
diff --git a/t/test-driver-is-distributed.sh b/t/test-driver-is-distributed.sh
index d21a9c0c3..1feb27fc8 100644
--- a/t/test-driver-is-distributed.sh
+++ b/t/test-driver-is-distributed.sh
@@ -21,6 +21,15 @@
 am_create_testdir=empty
 . test-init.sh
 
+# For performance - run aclocal just once
+# (but call all the marcos that may be used later):
+unindent > configure.ac << END
+    AC_INIT([$me], [1.0])
+    AM_INIT_AUTOMAKE
+END
+$ACLOCAL
+rm -rf configure.ac autom4te.*
+
 ocwd=$(pwd) || fatal_ "getting current working directory"
 
 for i in 1 2; do
@@ -62,7 +71,9 @@ END
     exit 0
 END
   chmod a+x tests/foo.test
-  $ACLOCAL
+  # Save time:
+  #$ACLOCAL
+  cp ../aclocal.m4 .
   $AUTOCONF
   $AUTOMAKE -a
   ./configure
diff --git a/t/vala-configure.sh b/t/vala-configure.sh
index 7d2c7b3ca..d477f8da0 100644
--- a/t/vala-configure.sh
+++ b/t/vala-configure.sh
@@ -92,7 +92,9 @@ $MAKE no-valac
 sed 's/^\(AM_PROG_VALAC\).*/\1([1], [: > ok], [: > ko])/' <configure.ac >t
 mv -f t configure.ac
 rm -rf autom4te*.cache
-$ACLOCAL
+# Save time:
+#$ACLOCAL
+touch aclocal.m4
 $AUTOCONF
 
 st=0; ./configure 2>stderr || st=$?
diff --git a/t/warning-groups-win-over-strictness.sh b/t/warning-groups-win-over-strictness.sh
index 0ebb8dadb..8cff93d3e 100644
--- a/t/warning-groups-win-over-strictness.sh
+++ b/t/warning-groups-win-over-strictness.sh
@@ -52,13 +52,15 @@ grep '^Makefile\.am:.*:=.*not portable' stderr
 rm -rf autom4te*.cache
 : > automake-options.am
 echo 'AM_INIT_AUTOMAKE([-Werror -Wnone gnu])' > am-init-automake.m4
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 $AUTOMAKE
 
 rm -rf autom4te*.cache
 echo 'AUTOMAKE_OPTIONS = -Werror -Wnone gnits' > automake-options.am
 echo 'AM_INIT_AUTOMAKE' > am-init-automake.m4
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 $AUTOMAKE
 
 :
diff --git a/t/warnings-precedence.sh b/t/warnings-precedence.sh
index 0af2b646b..2301db164 100644
--- a/t/warnings-precedence.sh
+++ b/t/warnings-precedence.sh
@@ -59,16 +59,19 @@ ko -Wno-portability -Wportability
 set_warnings '' Makefile.am
 set_warnings '-Wportability -Wno-portability' configure.ac
 rm -rf autom4te*.cache
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 ok
 set_warnings '-Wno-portability -Wportability' configure.ac
 rm -rf autom4te*.cache
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 ko
 
 set_warnings '' configure.ac
 rm -rf autom4te*.cache
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 set_warnings '-Wportability -Wno-portability' Makefile.am
 ok
 set_warnings '-Wno-portability -Wportability' Makefile.am
diff --git a/t/warnings-strictness-interactions.sh b/t/warnings-strictness-interactions.sh
index a575a7040..030f80e86 100644
--- a/t/warnings-strictness-interactions.sh
+++ b/t/warnings-strictness-interactions.sh
@@ -53,7 +53,8 @@ set_am_opts '-Wno-portability' configure.ac
 set_am_opts 'gnu' Makefile.am
 
 AUTOMAKE_fails
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 grep '^Makefile\.am:2:.*:=.*not portable' stderr
 
 :
diff --git a/t/warnopts.sh b/t/warnopts.sh
index 4afe1c2f8..3c475db8c 100644
--- a/t/warnopts.sh
+++ b/t/warnopts.sh
@@ -69,7 +69,8 @@ AM_INIT_AUTOMAKE([-Wnone])
 AC_CONFIG_FILES([Makefile sub/Makefile])
 AC_OUTPUT
 END
-$ACLOCAL
+# Save time:
+#$ACLOCAL
 $AUTOMAKE
 
 :
-- 
2.35.1

Reply via email to