]> git.ipfire.org Git - thirdparty/automake.git/commitdiff
tests: report useful system information in 'test-suite.log'
authorStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 22 Dec 2011 09:34:28 +0000 (10:34 +0100)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Thu, 22 Dec 2011 14:32:15 +0000 (15:32 +0100)
It has already happened various times that a user has run the
automake testsuite, experienced a failure, read the messages
telling him "See tests/test-suite.log" and "Please report to
bug-automake@gnu.org", and done exactly that -- sending us only
the contents of `tests/test-suite.log', which are usually not
enough to start debugging the reported failure.  So we have to
ask him for more details, and usually also for the `config.log'
file generated by configure.  It's time to fix this recurring
feedback inefficiency.  We do so by creating a dummy test case
that takes care of copying the contents of `config.log', plus
other useful system information, in the final `test-suite.log'.

* tests/get-sysconf.test: New test, gathering system information
and then always terminating with a SKIP, so that its output gets
copied in `test-suite.log'.
* tests/Makefile.am (TESTS): Add it.

ChangeLog
tests/Makefile.am
tests/get-sysconf.test [new file with mode: 0755]

index a8f181665ee4f7c99b8511edd6d4785f6c6d54a0..de95269892a3ccdd90b3e43106b440ff4a9a0c92 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2011-12-22  Stefano Lattarini  <stefano.lattarini@gmail.com>
+
+       tests: report useful system information in 'test-suite.log'
+       It has already happened various times that a user has run the
+       automake testsuite, experienced a failure, read the messages
+       telling him "See tests/test-suite.log" and "Please report to
+       bug-automake@gnu.org", and done exactly that -- sending us only
+       the contents of `tests/test-suite.log', which are usually not
+       enough to start debugging the reported failure.  So we have to
+       ask him for more details, and usually also for the `config.log'
+       file generated by configure.  It's time to fix this recurring
+       feedback inefficiency.  We do so by creating a dummy test case
+       that takes care of copying the contents of `config.log', plus
+       other useful system information, in the final `test-suite.log'.
+       * tests/get-sysconf.test: New test, gathering system information
+       and then always terminating with a SKIP, so that its output gets
+       copied in `test-suite.log'.
+       * tests/Makefile.am (TESTS): Add it.
+
 2011-12-07  Reuben Thomas  <rrt@sc3d.org>  (tiny change)
 
        python: remove relics for Python 1.5 support
index 8e3c1d128f9c1a1835d4eadc4c75561e8764af5d..1ad0cfbb91443448620c07e6c73c12db2edbb416 100644 (file)
@@ -52,6 +52,7 @@ TESTS_ENVIRONMENT = \
   test x"$$parallel_tests" = x || unset parallel_tests;
 
 TESTS = \
+get-sysconf.test \
 self-check-env-sanitize.test \
 self-check-report.test \
 aclibobj.test \
diff --git a/tests/get-sysconf.test b/tests/get-sysconf.test
new file mode 100755 (executable)
index 0000000..32d1038
--- /dev/null
@@ -0,0 +1,48 @@
+#! /bin/sh
+# Copyright (C) 2011 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/>.
+
+# Dummy test case, aimed at reporting useful system information in the
+# final `test-suite.log'.  This way, if a user experiencing a failure in
+# the Automake test suite only sends us the `test-suite.log' file upon,
+# we won't have to ask him for more information to start analyzing the
+# failure (that had happened too many times in the past!).
+
+. ./defs || Exit 1
+
+set -e
+
+# FIXME: remove these once we are merged into master.
+top_testsrcdir=$testsrcdir/..
+testbuilddir=`(cd .. && pwd)`
+top_testbuilddir=`(cd $testbuilddir/.. && pwd)`
+
+st=0
+sed 20q "$top_testsrcdir/ChangeLog" || st=1
+$PERL -V || st=1
+cat "$top_testbuilddir/config.log" || st=1
+cat "$testbuilddir/aclocal-$APIVERSION" || st=1
+cat "$testbuilddir/automake-$APIVERSION" || st=1
+
+if test $st -eq 0; then
+  # This test SKIPs, so that all the information is has gathered and
+  # printed will get unconditionally copied into the `test-suite.log'
+  # file.
+  Exit 77
+fi
+
+# Some unexpected error occurred; this must be reported as an hard
+# error by the testsuite driver.
+Exit 99