automake-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.12-43-gf


From: Stefano Lattarini
Subject: [Automake-commit] [SCM] GNU Automake branch, maint, updated. v1.12-43-gf9dbb0a
Date: Wed, 02 May 2012 10:55:04 +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=f9dbb0a6294fa6978833f9eb1b3286f076a8f986

The branch, maint has been updated
       via  f9dbb0a6294fa6978833f9eb1b3286f076a8f986 (commit)
       via  4c2dd6e09a01656b0ab0838812559a69e12e7b5e (commit)
       via  5eeb36603d197ed73a031cea70843e9b43d312b9 (commit)
       via  f5733aabe7c186a04f288214cb840a423d5b821b (commit)
       via  6e5b444165b420ba757fed2f3973da37d6df6ffe (commit)
      from  93814708ba465b5834ec10ec1fb66eceb9674274 (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 f9dbb0a6294fa6978833f9eb1b3286f076a8f986
Merge: 9381470 4c2dd6e
Author: Stefano Lattarini <address@hidden>
Date:   Wed May 2 12:51:09 2012 +0200

    Merge branch 'parallel-tests-performance' into maint
    
    * parallel-tests-performance:
      parallel-tests: save few forks when possible
      parallel-tests: optimize global log creation
      parallel-tests: optimize 'recheck' target for speed
      coverage: add performance tests on some parallel-tests aspects

commit 4c2dd6e09a01656b0ab0838812559a69e12e7b5e
Author: Stefano Lattarini <address@hidden>
Date:   Mon Apr 30 22:18:24 2012 +0200

    parallel-tests: save few forks when possible
    
    * lib/am/check.am (am__check_pre): Save some forks, by analyzing more
    carefully the value of '$@' to decide how to extract its dirname part,
    and whether that should be created as a directory.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 5eeb36603d197ed73a031cea70843e9b43d312b9
Author: Stefano Lattarini <address@hidden>
Date:   Sun Feb 26 00:30:18 2012 +0100

    parallel-tests: optimize global log creation
    
    With this change, the time required to execute the test case
    'testsuite-summary-speed.sh' has dropped as follows:
    
      + Slow Debian i686 system, 1 core x 1.5 GHz, 768 MB of RAM,
        GNU make 3.81:
          - 1 run: 4 minutes => 30/40 seconds
    
      + Fast Solaris 10 i686 system, 4 cores x 3 GHz, 20 GB of RAM,
        Solaris CCS make:
         - 2 runs: 6 minutes => 30 seconds
    
      + Very fast Fedora ppc64 system, 64 cores x 3.5 GHz, 64 GB of RAM,
        GNU make 3.82:
         - 5 runs: 7 minutes => 1 minute and 10 seconds
    
    * lib/am/check.am ($(TEST_SUITE_LOG)): Optimize for speed, by avoiding
    lots of forks with the help of ...
    (am__create_global_log): ... this new internal variable, basically
    defining a smart awk program, and ...
    (am__global_test_result_rx, am__copy_in_global_log_rx): ... these new
    internal variables, used by the one above.
    (am__rst_section): Remove as obsolete
    * t/rst-formatting.trs: Remove.
    * t/list-of-tests.mk: Update.
    * t/testsuite-summary-count-many.sh: Improve its stress testing by
    using 1 million tests rather than just 5 thousands: we can afford
    this with our new optimization, and still have the test completed
    in a reasonable time.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit f5733aabe7c186a04f288214cb840a423d5b821b
Author: Stefano Lattarini <address@hidden>
Date:   Thu Apr 26 22:25:35 2012 +0200

    parallel-tests: optimize 'recheck' target for speed
    
    With this change, the time required to execute the test case
    'testsuite-recheck-speed.sh' has dropped as follows:
    
      + Slow Debian i686 system, 1 core x 1.5 GHz, 768 MB of RAM,
        GNU make 3.81:
          - 1 run: 6 minutes => 40 seconds
    
      + Fast Solaris 10 i686 system, 4 cores x 3 GHz, 20 GB of RAM,
        Solaris CCS make:
          - 4 runs: 3 minutes => 1 minute
    
      + Very fast Fedora ppc64 system, 64 cores x 3.5 GHz, 64 GB of RAM,
        GNU make 3.82:
          - 5 runs: 4 minutes => 1 minute 30 seconds
    
    * lib/am/check.am (recheck): Optimize for speed, by avoiding lots of
    forks with the help of ...
    (am__list_recheck_tests): ... this new internal variable, basically
    defining a proper awk program, and ...
    (am__recheck_rx): ... this other new internal variable, used by the
    one above.
    * t/test-trs-recover2.sh: Relax by not checking for a very corner
    case ('.log' and '.trs' files both unreadable) that we don't handle
    anymore.
    
    Signed-off-by: Stefano Lattarini <address@hidden>

commit 6e5b444165b420ba757fed2f3973da37d6df6ffe
Author: Stefano Lattarini <address@hidden>
Date:   Sun Feb 26 09:42:11 2012 +0100

    coverage: add performance tests on some parallel-tests aspects
    
    * t/testsuite-recheck-speed.sh: New test.
    * t/testsuite-summary-speed.sh: Likewise.
    * t/list-of-tests.mk: Update.
    
    The new tests are not meant to PASS/FAIL, but rather to help us to
    obtain quantitative measurements of the performance improvements
    offered by soon-to-appear optimization patches.
    
    Timing before the optimizations implemented by following patches:
    
      + Slow Debian i686 system, 1 core x 1.5 GHz, 768 MB of RAM,
        GNU make 3.81:
         - testsuite-recheck-speed.sh: 1 run, ~ 6 minutes
         - testsuite-summary-speed.sh: 1 run, ~ 4 minutes
    
      + Fast Solaris 10 i686 system, 4 cores x 3 GHz, 20 GB of RAM,
        Solaris CCS make:
         - testsuite-recheck-speed.sh: 4 runs, ~ 3 minutes
         - testsuite-summary-speed.sh: 2 runs, ~ 6 minutes
    
      + Very fast Fedora ppc64 system, 64 cores x 3.5 GHz, 64 GB of RAM,
        GNU make 3.82:
         - testsuite-recheck-speed.sh: 5 runs, ~ 4 minutes
         - testsuite-summary-speed.sh: 5 runs, ~ 7 minutes
    
    Signed-off-by: Stefano Lattarini <address@hidden>

-----------------------------------------------------------------------

Summary of changes:
 lib/am/check.am                   |  185 ++++++++++++++++++++++++++-----------
 t/list-of-tests.mk                |    3 +-
 t/rst-formatting.sh               |   93 -------------------
 t/test-trs-recover2.sh            |   10 --
 t/testsuite-recheck-speed.sh      |   99 ++++++++++++++++++++
 t/testsuite-summary-count-many.sh |    4 +-
 t/testsuite-summary-speed.sh      |   76 +++++++++++++++
 7 files changed, 307 insertions(+), 163 deletions(-)
 delete mode 100755 t/rst-formatting.sh
 create mode 100755 t/testsuite-recheck-speed.sh
 create mode 100755 t/testsuite-summary-speed.sh

diff --git a/lib/am/check.am b/lib/am/check.am
index 73febb1..522c953 100644
--- a/lib/am/check.am
+++ b/lib/am/check.am
@@ -59,9 +59,112 @@ include inst-vars.am
 ## of more test metadata, and the use of custom test derivers and protocols
 ## (among them, TAP).
 
-# Restructured Text title and section.
+am__recheck_rx = ^[    ]*:recheck:[    ]*
+am__global_test_result_rx = ^[         ]*:global-test-result:[         ]*
+am__copy_in_global_log_rx = ^[         ]*:copy-in-global-log:[         ]*
+
+# A command that, given a newline-separated list of test names on the
+# standard input, print the name of the tests that are to be re-run
+# upon "make recheck".
+am__list_recheck_tests = $(AWK) '{ \
+## By default, we assume the test is to be re-run.
+  recheck = 1; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+        { \
+## If we've encountered an I/O error here, there are three possibilities:
+##
+##  [1] The '.log' file exists, but the '.trs' does not; in this case,
+##      we "gracefully" recover by assuming the corresponding test is
+##      to be re-run (which will re-create the missing '.trs' file).
+##
+##  [2] Both the '.log' and '.trs' files are missing; this means that
+##      the corresponding test has not been run, and is thus *not* to
+##      be re-run.
+##
+##  [3] We have encountered some corner-case problem (e.g., a '.log' or
+##      '.trs' files somehow made unreadable, or issues with a bad NFS
+##      connection, or whatever); we don't handle such corner cases.
+##
+          if ((getline line2 < ($$0 ".log")) < 0) \
+           recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \
+## A directive explicitly specifying the test is *not* to be re-run.
+        { \
+          recheck = 0; \
+          break; \
+        } \
+      else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \
+        { \
+## A directive explicitly specifying the test *is* to be re-run.
+          break; \
+        } \
+## else continue with the next iteration.
+    }; \
+  if (recheck) \
+    print $$0; \
+## Don't leak open file descriptors, as this could cause serious
+## problems when there are many tests (yes, even on Linux).
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+
+# A command that, given a newline-separated list of test names on the
+# standard input, create the global log from their .trs and .log files.
+am__create_global_log = $(AWK) ' \
+function fatal(msg) \
+{ \
+  print "fatal: making $@: " msg | "cat >&2"; \
+  exit 1; \
+} \
+function rst_section(header) \
+{ \
+  print header; \
+  len = length(header); \
+  for (i = 1; i <= len; i = i + 1) \
+    printf "="; \
+  printf "\n\n"; \
+} \
+{ \
+## By default, we assume the test log is to be copied in the global log,
+## and that its result is simply "RUN" (i.e., we still don't know what
+## it outcome was, but we know that at least it has run).
+  copy_in_global_log = 1; \
+  global_test_result = "RUN"; \
+  while ((rc = (getline line < ($$0 ".trs"))) != 0) \
+    { \
+      if (rc < 0) \
+         fatal("failed to read from " $$0 ".trs"); \
+      if (line ~ /$(am__global_test_result_rx)/) \
+        { \
+          sub("$(am__global_test_result_rx)", "", line); \
+          sub("[       ]*$$", "", line); \
+          global_test_result = line; \
+        } \
+      else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \
+        copy_in_global_log = 0; \
+    }; \
+  if (copy_in_global_log) \
+    { \
+      rst_section(global_test_result ": " $$0); \
+      while ((rc = (getline line < ($$0 ".log"))) != 0) \
+      { \
+        if (rc < 0) \
+          fatal("failed to read from " $$0 ".log"); \
+        print line; \
+      }; \
+    }; \
+## Don't leak open file descriptors, as this could cause serious
+## problems when there are many tests (yes, even on Linux).
+  close ($$0 ".trs"); \
+  close ($$0 ".log"); \
+}'
+
+# Restructured Text title.
 am__rst_title = { sed 's/.*/   &   /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; }
-am__rst_section = { sed 'p;s/./=/g;' && echo; }
 
 # Solaris 10 'make', and several other traditional 'make' implementations,
 # pass "-e" to $(SHELL), and POSIX 2008 even requires this.  Work around it
@@ -86,8 +189,12 @@ $(am__sh_e_setup);                                  \
 $(am__vpath_adj_setup) $(am__vpath_adj)                        \
 $(am__tty_colors);                                     \
 srcdir=$(srcdir); export srcdir;                       \
-am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;           \
-test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?;        \
+case "$@" in                                           \
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;   \
+    *) am__odir=.;;                                    \
+esac;                                                  \
+test "x$$am__odir" = x"." || test -d "$$am__odir"      \
+  || $(MKDIR_P) "$$am__odir" || exit $$?;              \
 if test -f "./$$f"; then dir=./;                       \
 elif test -f "$$f"; then dir=;                         \
 else dir="$(srcdir)/"; fi;                             \
@@ -248,29 +355,9 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
          echo;                                                         \
          echo ".. contents:: :depth: 2";                               \
          echo;                                                         \
-         for i in $$bases; do                                          \
-## FIXME: one fork per test -- this is horrendously inefficient!
-           if grep "^$$ws*:copy-in-global-log:$$ws*no$$ws*$$" $$i.trs \
-                >/dev/null; then continue; \
-           fi; \
-## Get the declared "global result" of the test.
-## FIXME: yet another one fork per test here!
-           glob_res=`sed -n -e "s/$$ws*$$//" \
-                            -e "s/^$$ws*:global-test-result:$$ws*//p" \
-                       $$i.trs`; \
-## If no global result is explicitly declared, we'll merely mark the
-## test as "RUN" in the global test log.
-           test -n "$$glob_res" || glob_res=RUN; \
-## Write the name and result of the test as an RST section title.
-           echo "$$glob_res: $$i" | $(am__rst_section); \
-## If we should have remade any unreadable '.log', above.
-           if test ! -r $$i.log; then \
-             echo "fatal: making $@: $$i.log is unreadable" >&2; \
-             exit 1; \
-           fi; \
-           cat $$i.log; echo; \
-         done; \
-       } >$(TEST_SUITE_LOG).tmp;                                       \
+         for b in $$bases; do echo $$b; done                           \
+           | $(am__create_global_log);                                 \
+       } >$(TEST_SUITE_LOG).tmp || exit 1;                             \
        mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG);                     \
 ## Emit the test summary on the console.
        if $$success; then                                              \
@@ -330,36 +417,22 @@ check-TESTS recheck:
 ## cannot use '$?' to compute the set of lazily rerun tests, lest
 ## we rely on .PHONY to work portably.
        @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG)
-       @ws='[  ]'; \
-       log_list='' trs_list=''; $(am__set_TESTS_bases); \
-       for i in $$bases; do \
+       @$(am__set_TESTS_bases); \
+       if test $@ = recheck; then \
 ## If running a "make recheck", we must only consider tests that had an
-## unexpected outcome (FAIL or XPASS) in the earlier run.  In particular,
-## skip tests that haven't been run.  But recover gracefully from deleted
-## '.trs' files.
-         if test $@ = recheck; then \
-           test -f $$i.trs || test -f $$i.log || continue; \
-## FIXME: one fork per test -- this is horrendously inefficient!
-           grep "^$$ws*:recheck:$$ws*no$$ws*$$" $$i.trs \
-             >/dev/null 2>&1 && continue; \
-         else :; fi; \
-## Be careful to avoid extra whitespace in the definition of $list, since
-## its value will be passed to the recursive make invocation below through
-## the TEST_LOGS macro, and leading/trailing white space in a make macro
-## definition can be problematic.  In this particular case, trailing white
-## space was known to cause a segmentation fault on Solaris 10 XPG4 make:
-## <http://lists.gnu.org/archive/html/bug-automake/2010-08/msg00004.html>
-         if test -z "$$log_list"; then \
-           log_list="$$i.log"; \
-         else \
-           log_list="$$log_list $$i.log"; \
-         fi; \
-         if test -z "$$trs_list"; then \
-           trs_list="$$i.trs"; \
-         else \
-           trs_list="$$trs_list $$i.trs"; \
-         fi; \
-       done; \
+## unexpected outcome (FAIL or XPASS) in the earlier run.
+         bases=`for i in $$bases; do echo $$i; done \
+                  | $(am__list_recheck_tests)` || exit 1; \
+       fi; \
+       log_list=`for i in $$bases; do echo $$i.log; done`; \
+       trs_list=`for i in $$bases; do echo $$i.trs; done`; \
+## Remove newlines and normalize whitespace, being careful to avoid extra
+## whitespace in the definition of $log_list, since its value will be
+## passed to the recursive make invocation below through the TEST_LOGS
+## macro, and leading/trailing white space in a make macro definition can
+## be problematic.  In this particular case, trailing white space is known
+## to have caused segmentation faults on Solaris 10 XPG4 make:
+       log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \
 ## Under "make recheck", remove the .log and .trs files associated
 ## with the files to recheck, so that those will be rerun by the
 ## "make test-suite.log" recursive invocation below.  But use a proper
diff --git a/t/list-of-tests.mk b/t/list-of-tests.mk
index dbc9a10..f07d646 100644
--- a/t/list-of-tests.mk
+++ b/t/list-of-tests.mk
@@ -777,6 +777,8 @@ t/testsuite-summary-color.sh \
 t/testsuite-summary-count.sh \
 t/testsuite-summary-count-many.sh \
 t/testsuite-summary-reference-log.sh \
+t/testsuite-recheck-speed.sh \
+t/testsuite-summary-speed.sh \
 t/test-driver-acsubst.sh \
 t/test-driver-cond.sh \
 t/test-driver-custom-no-extra-driver.sh \
@@ -934,7 +936,6 @@ t/req.sh \
 t/reqd.sh \
 t/reqd2.sh \
 t/repeated-options.sh \
-t/rst-formatting.sh \
 t/rulepat.sh \
 t/self-check-cleanup.tap \
 t/self-check-configure-help.sh \
diff --git a/t/rst-formatting.sh b/t/rst-formatting.sh
deleted file mode 100755
index f23c28c..0000000
--- a/t/rst-formatting.sh
+++ /dev/null
@@ -1,93 +0,0 @@
-#! /bin/sh
-# Copyright (C) 2012 Free Software Foundation, Inc.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Parallel testsuite harness: check APIs for the registering the
-# "global test result" in '*.trs' files, as documented in the automake
-# manual.
-
-am_create_testdir=empty
-. ./defs || Exit 1
-
-sed -n '/^am__rst_[a-z_][a-z_]* =/p' "$am_amdir"/check.am > Makefile \
-  || framework_failure_ "fetching definitions from check.am"
-
-cat >> Makefile << 'END'
-test:
-       printf '%s\n' "$$in" | $(am__rst_title) > title-got
-       printf '%s\n' "$$in" | $(am__rst_section) > section-got
-       cat title-exp
-       cat title-got
-       diff title-exp title-got
-       cat section-exp
-       cat section-got
-       diff section-exp section-got
-END
-
-# -------------------------------------------------------------------------
-
-cat > title-exp <<'END'
-==============
-   ab cd ef
-==============
-
-END
-
-cat > section-exp <<'END'
-ab cd ef
-========
-
-END
-
-env in='ab cd ef' $MAKE test
-
-# -------------------------------------------------------------------------
-
-cat > title-exp <<'END'
-============================================================================
-   0123456789012345678901234567890123456789012345678901234567890123456789
-============================================================================
-
-END
-
-cat > section-exp <<'END'
-0123456789012345678901234567890123456789012345678901234567890123456789
-======================================================================
-
-END
-
-in=0123456789012345678901234567890123456789012345678901234567890123456789
-env in=$in $MAKE test
-
-# -------------------------------------------------------------------------
-
-cat > title-exp <<'END'
-=======
-   x
-=======
-
-END
-
-cat > section-exp <<'END'
-x
-=
-
-END
-
-env in=x $MAKE test
-
-# -------------------------------------------------------------------------
-
-:
diff --git a/t/test-trs-recover2.sh b/t/test-trs-recover2.sh
index 9726870..a154ce7 100755
--- a/t/test-trs-recover2.sh
+++ b/t/test-trs-recover2.sh
@@ -80,16 +80,6 @@ test -r bar.trs
 grep '^PASS: foo\.test' stdout
 grep '^PASS: bar\.test' stdout
 
-: More complex interactions with "make recheck" are OK.
-chmod a-r bar.log bar.trs
-$MAKE recheck >stdout || { cat stdout; Exit 1; }
-cat stdout
-test -f bar.trs
-test -r bar.trs
-grep '^PASS: bar\.test' stdout
-grep 'foo\.test' stdout && Exit 1
-count_test_results total=1 pass=1 fail=0 xpass=0 xfail=0 skip=0 error=0
-
 : Recreate by remaking the global test log.
 chmod a-r foo.trs
 rm -f test-suite.log
diff --git a/t/testsuite-recheck-speed.sh b/t/testsuite-recheck-speed.sh
new file mode 100755
index 0000000..9b37262
--- /dev/null
+++ b/t/testsuite-recheck-speed.sh
@@ -0,0 +1,99 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check performance of recheck target in the face of many failed tests.
+# FIXME: this test is not currently able to detect whether the measured
+# FIXME: performance is too low, and FAIL accordingly; it just offers an
+# FIXME: easy way to verify how effective a performance optimization is.
+
+am_parallel_tests=yes
+. ./defs || Exit 1
+
+count=5000
+
+cat >> configure.ac <<'END'
+AC_OUTPUT
+END
+
+cat > Makefile.am <<END
+count_expected = $count
+TEST_EXTENSIONS = .t
+## Updated later.
+TESTS =
+END
+
+# This should ensure that our timing won't be disturbed by the time
+# that would be actually required to run any of:
+#  - the test cases
+#  - the test driver executing them
+#  - the recipe to create the final test-suite log.
+cat >> Makefile.am << 'END'
+AUTOMAKE_OPTIONS = -Wno-override
+## These should never be run.
+T_LOG_COMPILER = false
+T_LOG_DRIVER = false
+
+# The recipe of this also serves as a sanity check.
+$(TEST_SUITE_LOG):
+## For debugging.
+       @echo "RE-RUN:"; for i in $(TEST_LOGS); do echo "  $$i"; done
+## All the test cases should have been re-run.
+       @count_got=`for i in $(TEST_LOGS); do echo $$i; done | wc -l` \
+         && echo "Count expected: $(count_expected)" \
+         && echo "Count obtained: $$count_got" \
+         && test $$count_got -eq $(count_expected)
+## Pre-existing log files of the tests to re-run should have been
+## removed by the 'recheck' target
+       @for i in $(TEST_LOGS); do \
+         test ! -f $$i.log || { echo "$$i.log exists!"; exit 1; }; \
+       done
+## Actually create the target file, for extra safety.
+       @echo dummy > $@
+END
+
+# Updated later.
+: > all
+
+# Temporarily disable shell traces, to avoid bloating the log file.
+set +x
+
+for i in `seq_ 1 $count`; do
+  echo dummy $i > $i.log
+  echo :global-test-result: PASS > $i.trs
+  echo :test-result: PASS >> $i.trs
+  echo :recheck: yes >> $i.trs
+  echo TESTS += $i.t >> Makefile.am
+  echo $i >> all
+done
+
+# Re-enable shell traces.
+set -x
+
+# So that we don't need to create a ton of dummy tests.
+echo '$(TESTS):' >> Makefile.am
+
+head -n 100 Makefile.am || : # For debugging.
+tail -n 100 Makefile.am || : # Likewise.
+cat $count.trs               # Likewise, just the last specimen though.
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+$MAKE recheck
+
+:
diff --git a/t/testsuite-summary-count-many.sh 
b/t/testsuite-summary-count-many.sh
index 58157ad..ff38097 100755
--- a/t/testsuite-summary-count-many.sh
+++ b/t/testsuite-summary-count-many.sh
@@ -56,9 +56,7 @@ $PERL -w -e '
   use warnings FATAL => "all";
   use strict;
 
-  # FIXME: we would like this to be 1000 or even 10000, but the current
-  # implementation is too slow to handle that :-(
-  my $base = 5;
+  my $base = 1000;
   my %count = (
     TOTAL => $base * 1000,
     PASS  => $base * 700,
diff --git a/t/testsuite-summary-speed.sh b/t/testsuite-summary-speed.sh
new file mode 100755
index 0000000..4d18c61
--- /dev/null
+++ b/t/testsuite-summary-speed.sh
@@ -0,0 +1,76 @@
+#! /bin/sh
+# Copyright (C) 2012 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Check performanceof recipe generating test-suite.log file and testsuite
+# summary.  That has suffered of huge inefficiencies in the past.
+# FIXME: this test is not currently able to detect whether the measured
+# FIXME: performance is too low, and FAIL accordingly; it just offers
+# FIXME: an easy way verify how effective a performance optimization is.
+
+am_parallel_tests=yes
+. ./defs || Exit 1
+
+count=10000
+
+echo AC_OUTPUT >> configure.ac
+
+cat > Makefile.am <<'END'
+TEST_EXTENSIONS = .t
+## Will be updated later.
+TESTS =
+## None of these should ever be run.
+T_LOG_COMPILER = false
+T_LOG_DRIVER = false
+END
+
+# Temporarily disable shell traces, to avoid bloating the log file.
+set +x
+
+for i in `seq_ 1 $count`; do
+  echo false > $i.t
+  echo dummy $i > $i.log
+  echo :global-test-result: PASS > $i.trs
+  echo :test-result: PASS >> $i.trs
+  echo :copy-in-global-log: yes >> $i.trs
+  echo TESTS += $i.t
+done >> Makefile.am 
+
+# Re-enable shell traces.
+set -x
+
+head -n 100 Makefile.am || : # For debugging.
+tail -n 100 Makefile.am || : # Likewise.
+cat $count.trs               # Likewise, just the last specimen though.
+
+# So that we don't need to create a ton of dummy tests.
+#echo '$(TESTS):' >> Makefile.am
+
+$ACLOCAL
+$AUTOCONF
+$AUTOMAKE -a
+
+./configure
+
+$MAKE test-suite.log >stdout || { cat stdout; Exit 1; }
+cat stdout
+
+# Sanity checks.
+grep "^# TOTAL: $count$" stdout
+grep "^dummy $count$" test-suite.log
+specimen=347 # Could be any number <= $count.
+grep "^dummy $specimen$" test-suite.log
+
+:


hooks/post-receive
-- 
GNU Automake



reply via email to

[Prev in Thread] Current Thread [Next in Thread]