From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Jakub Narebski" <jnareb@gmail.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [PATCH v2 1/3] t/gitweb-lib.sh: print to stderr when gitweb_run has errors
Date: Sat, 19 Feb 2011 15:27:40 +0000 [thread overview]
Message-ID: <1298129262-10468-2-git-send-email-avarab@gmail.com> (raw)
In-Reply-To: <1298124654-12051-1-git-send-email-avarab@gmail.com>
In-Reply-To: <1298124654-12051-1-git-send-email-avarab@gmail.com>
Change the gitweb_run test subroutine to spew errors to stderr if
there are any, previously it would just silently fail, which made
tests very hard to debug.
Before you'd get this output, when running tests under `--verbose
--immediate --debug`:
expecting success: git rm renamed_file &&
rm -f renamed_file &&
git commit -a -m "File removed." &&
gitweb_run "p=.git;a=commitdiff"
rm 'renamed_file'
[master 8d80741] File removed.
Author: A U Thor <author@example.com>
1 files changed, 0 insertions(+), 1 deletions(-)
delete mode 120000 renamed_file
not ok - 32 commitdiff(0): file deleted
# git rm renamed_file &&
# rm -f renamed_file &&
# git commit -a -m "File removed." &&
# gitweb_run "p=.git;a=commitdiff"
Now you'll get the much more useful:
expecting success: git rm renamed_file &&
rm -f renamed_file &&
git commit -a -m "File removed." &&
gitweb_run "p=.git;a=commitdiff"
rm 'renamed_file'
[master 2a4214e] File removed.
Author: A U Thor <author@example.com>
1 files changed, 0 insertions(+), 1 deletions(-)
delete mode 120000 renamed_file
[Sat Feb 19 14:32:54 2011] gitweb.perl: Use of uninitialized value in subroutine entry at /home/avar/g/git/t/../gitweb/gitweb.perl line 4415.
not ok - 32 commitdiff(0): file deleted
# git rm renamed_file &&
# rm -f renamed_file &&
# git commit -a -m "File removed." &&
# gitweb_run "p=.git;a=commitdiff"
---
t/gitweb-lib.sh | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index b9bb95f..2388b0f 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -82,7 +82,12 @@ gitweb_run () {
}
close O;
' gitweb.output &&
- if grep '^[[]' gitweb.log >/dev/null 2>&1; then false; else true; fi
+ if grep '^[[]' gitweb.log >/dev/null 2>&1; then
+ cat gitweb.log >&2
+ false
+ else
+ true
+ fi
# gitweb.log is left for debugging
# gitweb.output is used to parse HTTP output
--
1.7.2.3
next prev parent reply other threads:[~2011-02-19 15:28 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-19 14:10 [PATCH] gitweb/gitweb.perl: remove use of qw(...) as parentheses Ævar Arnfjörð Bjarmason
2011-02-19 15:27 ` [PATCH v2 0/3] Fix failure-causing warnings in Gitweb + improve gitweb-lib.sh Ævar Arnfjörð Bjarmason
2011-02-19 15:27 ` Ævar Arnfjörð Bjarmason [this message]
2011-02-19 15:46 ` [PATCH v2 1/3] t/gitweb-lib.sh: print to stderr when gitweb_run has errors Jakub Narebski
2011-02-19 16:17 ` Ævar Arnfjörð Bjarmason
2011-02-19 18:16 ` Jakub Narebski
2011-02-19 19:11 ` Ævar Arnfjörð Bjarmason
2011-02-21 6:40 ` Junio C Hamano
2011-02-19 15:27 ` [PATCH v2 2/3] gitweb/gitweb.perl: remove use of qw(...) as parentheses Ævar Arnfjörð Bjarmason
2011-02-19 15:54 ` Jakub Narebski
2011-02-19 16:02 ` Jakub Narebski
2011-02-19 16:06 ` Ævar Arnfjörð Bjarmason
2011-02-20 14:42 ` Jakub Narebski
2011-02-19 15:27 ` [PATCH v2 3/3] gitweb/gitweb.perl: don't call S_ISREG() with undef Ævar Arnfjörð Bjarmason
2011-02-19 15:57 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1298129262-10468-2-git-send-email-avarab@gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jnareb@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).