On 03/11/2012 02:16 AM, P. Martin wrote:
>
> [SNIP] lots of details and good explanations
>
> Question.  Why does it search for ChangeLog if that file
> doesn't exist in head?
>
Basically, the test script 'get-sysconf.test' (whose aim is collecting bits
of information to help the debugging of testsuite failures) tries to look
at either the git history or the ChangeLog file to determine which the most
recent change is (and thus which "version" of automake is being tested).
Until now, the script assumed it would have been run from either a git
checkout (where the git history is available) or from a distribution
tarball (where the ChangeLog is available, being created upon "make dist").
Unfortunately, none of these assumption holds in the Homebrew case.  And
after spelling them out explicitly, I see they might not hold in other
corner or slightly unusual cases as well ...  So maybe the best solution
is to just relax the test.  The attached patch should do this (while fixing
also another unrelated weakness that I've noted while editing the tests).
I will push it in a couple of days (or before, if you confirm that it works
for you).

> Or is it searching thru ChangeLog*?
> It's like you're trying to detect homebrew rather than deal
> with the file not existing.  I must be missing something.
>
See above.

Thanks,
  Stefano



>From 715c684f98497d194e691f4aead67c7a66162042 Mon Sep 17 00:00:00 2001
Message-Id: <715c684f98497d194e691f4aead67c7a66162042.1331547784.git.stefano.lattar...@gmail.com>
From: Stefano Lattarini <stefano.lattar...@gmail.com>
Date: Sat, 10 Mar 2012 08:49:55 +0100
Subject: [PATCH] tests: avoid spurious failures in get-sysconf.test

This change fixes the last bit of automake bug#10866.

* tests/get-sysconf.test: When Homebrew spawns a build, even if
from a project's VCS, it stages the files in a new temporary
directory, instead of building directly from a VCS checkout.
This behaviour was causing a spurious failure in this test, which
expected to find either a ChangeLog file or a .git directory in
the source directory (the former happening when the test was run
from a distribution tarball, the latter when it was run from a
git checkout).  The Homebrew issue shows that these expectations
are not truly warranted, so relax the test to just give a warning,
not a failure, in case they do not hold.  Since we are at it, fix
an unrelated weakness in the displaying of the git log, which
could have failed when the builddir was not a subdirectory of the
srcdir.

Signed-off-by: Stefano Lattarini <stefano.lattar...@gmail.com>
---
 tests/get-sysconf.test |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/tests/get-sysconf.test b/tests/get-sysconf.test
index bad4735..cbcf076 100755
--- a/tests/get-sysconf.test
+++ b/tests/get-sysconf.test
@@ -32,16 +32,21 @@ top_testbuilddir=`(cd $testbuilddir/.. && pwd)`
 st=0
 if test -d "$top_testsrcdir"/.git; then
   # We are running from a git checkout.
-  git log -1 || st=1
-else
-  # We are probably running from a distribution tarball, so
-  # the ChangeLog file must be present.
+  (cd "$top_testsrcdir" && git log -1) || st=1
+elif test -f "$top_testsrcdir"/ChangeLog; then
+  # We are probably running from a distribution tarball.
   awk '
     BEGIN { first = 1 }
     (first == 1) { print; first = 0; next; }
     /^[^\t]/ { exit(0); }
     { print }
   ' "$top_testsrcdir"/ChangeLog || st=1
+else
+  # Some non-common but possibly valid setup (see for example the Homebrew
+  # problem reported in automake bug#10866); so just give an harmless
+  # warning instead of failing.
+  warn_ "no .git directory nor ChangeLog file found, some info won't" \
+        "be available"
 fi
 $PERL -V || st=1
 cat "$top_testbuilddir/config.log" || st=1
-- 
1.7.9

Reply via email to