From: Stephan Beyer <s-beyer@gmx.net>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: git@vger.kernel.org
Subject: Re: [HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.
Date: Sun, 13 Jul 2008 13:09:05 +0200 [thread overview]
Message-ID: <20080713110904.GG22323@leksak.fem-net> (raw)
In-Reply-To: <alpine.DEB.1.00.0807130222320.2995@eeepc-johanness>
Hi,
Johannes Schindelin wrote:
[...]
>
> Please clarify,
> Dscho
Ok, I add an example and show you what my output is using sh -x and my
hack. Perhaps you can point me to something that wents wrong.
First I make t4150 fail:
diff --git a/t/t4150-am.sh b/t/t4150-am.sh
index bc98260..07e626a 100755
--- a/t/t4150-am.sh
+++ b/t/t4150-am.sh
@@ -69,6 +69,7 @@ test_expect_success setup '
echo hello >file &&
git add file &&
test_tick &&
+ ! : &&
git commit -m first &&
git tag first &&
echo world >>file &&
Now:
-------------
$ ./t4150-am.sh -s
Initialized empty Git repository in /home/sbeyer/src/git/t/trash directory/.git/
* expecting success:
echo hello >file &&
git add file &&
test_tick &&
! : &&
git commit -m first &&
git tag first &&
echo world >>file &&
git add file &&
test_tick &&
git commit -s -F msg &&
git tag second &&
git format-patch --stdout first >patch1 &&
sed -n -e "3,\$p" msg >file &&
git add file &&
test_tick &&
git commit -m third &&
git format-patch --stdout first >patch2 &&
git checkout -b lorem &&
sed -n -e "11,\$p" msg >file &&
head -n 9 msg >>file &&
test_tick &&
git commit -a -m "moved stuff" &&
echo goodbye >another &&
git add another &&
test_tick &&
git commit -m "added another file" &&
git format-patch --stdout master >lorem-move.patch
Testing:
echo hello >file
-------
Testing:
git add file
-------
Testing:
test_tick
-------
Testing:
! :
* FAIL 1: setup
echo hello >file &&
git add file &&
test_tick &&
! : &&
git commit -m first &&
git tag first &&
echo world >>file &&
git add file &&
test_tick &&
git commit -s -F msg &&
git tag second &&
git format-patch --stdout first >patch1 &&
sed -n -e "3,\$p" msg >file &&
git add file &&
test_tick &&
git commit -m third &&
git format-patch --stdout first >patch2 &&
git checkout -b lorem &&
sed -n -e "11,\$p" msg >file &&
head -n 9 msg >>file &&
test_tick &&
git commit -a -m "moved stuff" &&
echo goodbye >another &&
git add another &&
test_tick &&
git commit -m "added another file" &&
git format-patch --stdout master >lorem-move.patch
-------------
And now sh -x:
-------------
$ sh --version
GNU bash, version 3.2.39(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
$ # no big differences using dash or zsh
$ sh -x ./t4150-am.sh -i
+ test_description='git am running'
+ . ./test-lib.sh
++ ORIGINAL_TERM=xterm
++ LANG=C
++ LC_ALL=C
++ PAGER=cat
++ TZ=UTC
++ TERM=dumb
++ export LANG LC_ALL PAGER TERM TZ
++ EDITOR=:
++ VISUAL=:
++ unset GIT_EDITOR
++ unset AUTHOR_DATE
++ unset AUTHOR_EMAIL
++ unset AUTHOR_NAME
++ unset COMMIT_AUTHOR_EMAIL
++ unset COMMIT_AUTHOR_NAME
++ unset EMAIL
++ unset GIT_ALTERNATE_OBJECT_DIRECTORIES
++ unset GIT_AUTHOR_DATE
++ GIT_AUTHOR_EMAIL=author@example.com
++ GIT_AUTHOR_NAME='A U Thor'
++ unset GIT_COMMITTER_DATE
++ GIT_COMMITTER_EMAIL=committer@example.com
++ GIT_COMMITTER_NAME='C O Mitter'
++ unset GIT_DIFF_OPTS
++ unset GIT_DIR
++ unset GIT_WORK_TREE
++ unset GIT_EXTERNAL_DIFF
++ unset GIT_INDEX_FILE
++ unset GIT_OBJECT_DIRECTORY
++ unset GIT_CEILING_DIRECTORIES
++ unset SHA1_FILE_DIRECTORIES
++ unset SHA1_FILE_DIRECTORY
++ GIT_MERGE_VERBOSITY=5
++ export GIT_MERGE_VERBOSITY
++ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME
++ export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME
++ export EDITOR VISUAL
++ GIT_TEST_CMP='diff -u'
++ unset CDPATH
++ case $(echo $GIT_TRACE |tr "[A-Z]" "[a-z]") in
+++ echo
+++ tr '[A-Z]' '[a-z]'
++ '[' xxterm '!=' xdumb ']'
++ TERM=xterm
++ export TERM
++ '[' -t 1 ']'
++ tput bold
++ tput setaf 1
++ tput sgr0
++ color=t
++ test 1 -ne 0
++ case "$1" in
++ immediate=t
++ shift
++ test 0 -ne 0
++ test -n t
++ test 'git am running' '!=' ''
++ test '' = t
++ exec
++ test '' = t
++ exec
++ test_failure=0
++ test_count=0
++ test_fixed=0
++ test_broken=0
++ test_success=0
++ trap die exit
+++ pwd
++ TEST_DIRECTORY=/home/sbeyer/src/git/t
++ PATH=/home/sbeyer/src/git/t/..:/home/sbeyer/bin/:/usr/local/bin:/usr/bin:/bin:/usr/games
+++ pwd
++ GIT_EXEC_PATH=/home/sbeyer/src/git/t/..
+++ pwd
++ GIT_TEMPLATE_DIR=/home/sbeyer/src/git/t/../templates/blt
++ unset GIT_CONFIG
++ unset GIT_CONFIG_LOCAL
++ GIT_CONFIG_NOSYSTEM=1
++ GIT_CONFIG_NOGLOBAL=1
++ export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL
+++ pwd
+++ pwd
++ GITPERLLIB=/home/sbeyer/src/git/t/../perl/blib/lib:/home/sbeyer/src/git/t/../perl/blib/arch/auto/Git
++ export GITPERLLIB
++ test -d ../templates/blt
++ test -x ../test-chmtime
++ . ../GIT-BUILD-OPTIONS
+++ SHELL_PATH=/bin/sh
++ test='trash directory'
++ rm -fr 'trash directory'
++ test_create_repo 'trash directory'
++ test 1 = 1
+++ pwd
++ owd=/home/sbeyer/src/git/t
++ repo='trash directory'
++ mkdir 'trash directory'
++ cd 'trash directory'
++ /home/sbeyer/src/git/t/../git init --template=/home/sbeyer/src/git/t/../templates/blt/
++ mv .git/hooks .git/hooks-disabled
++ cd /home/sbeyer/src/git/t
++ cd -P 'trash directory'
+++ expr ././t4150-am.sh : '.*/\(t[0-9]*\)-[^/]*$'
++ this_test=t4150
+ cat
+ cat
+ cat
+ echo 'Signed-off-by: C O Mitter <committer@example.com>'
+ test_expect_success setup '
echo hello >file &&
git add file &&
test_tick &&
! : &&
git commit -m first &&
git tag first &&
echo world >>file &&
git add file &&
test_tick &&
git commit -s -F msg &&
git tag second &&
git format-patch --stdout first >patch1 &&
sed -n -e "3,\$p" msg >file &&
git add file &&
test_tick &&
git commit -m third &&
git format-patch --stdout first >patch2 &&
git checkout -b lorem &&
sed -n -e "11,\$p" msg >file &&
head -n 9 msg >>file &&
test_tick &&
git commit -a -m "moved stuff" &&
echo goodbye >another &&
git add another &&
test_tick &&
git commit -m "added another file" &&
git format-patch --stdout master >lorem-move.patch
'
+ test 2 = 2
+ test_skip setup '
echo hello >file &&
git add file &&
test_tick &&
! : &&
git commit -m first &&
git tag first &&
echo world >>file &&
git add file &&
test_tick &&
git commit -s -F msg &&
git tag second &&
git format-patch --stdout first >patch1 &&
sed -n -e "3,\$p" msg >file &&
git add file &&
test_tick &&
git commit -m third &&
git format-patch --stdout first >patch2 &&
git checkout -b lorem &&
sed -n -e "11,\$p" msg >file &&
head -n 9 msg >>file &&
test_tick &&
git commit -a -m "moved stuff" &&
echo goodbye >another &&
git add another &&
test_tick &&
git commit -m "added another file" &&
git format-patch --stdout master >lorem-move.patch
'
++ expr ././t4150-am.sh : '.*/\(t[0-9]*\)-[^/]*$'
+ this_test=t4150
++ expr 0 + 1
+ this_test=t4150.1
+ to_skip=
+ case "$to_skip" in
+ false
+ say 'expecting success:
echo hello >file &&
git add file &&
test_tick &&
! : &&
git commit -m first &&
git tag first &&
echo world >>file &&
git add file &&
test_tick &&
git commit -s -F msg &&
git tag second &&
git format-patch --stdout first >patch1 &&
sed -n -e "3,\$p" msg >file &&
git add file &&
test_tick &&
git commit -m third &&
git format-patch --stdout first >patch2 &&
git checkout -b lorem &&
sed -n -e "11,\$p" msg >file &&
head -n 9 msg >>file &&
test_tick &&
git commit -a -m "moved stuff" &&
echo goodbye >another &&
git add another &&
test_tick &&
git commit -m "added another file" &&
git format-patch --stdout master >lorem-move.patch
'
+ say_color info 'expecting success:
echo hello >file &&
git add file &&
test_tick &&
! : &&
git commit -m first &&
git tag first &&
echo world >>file &&
git add file &&
test_tick &&
git commit -s -F msg &&
git tag second &&
git format-patch --stdout first >patch1 &&
sed -n -e "3,\$p" msg >file &&
git add file &&
test_tick &&
git commit -m third &&
git format-patch --stdout first >patch2 &&
git checkout -b lorem &&
sed -n -e "11,\$p" msg >file &&
head -n 9 msg >>file &&
test_tick &&
git commit -a -m "moved stuff" &&
echo goodbye >another &&
git add another &&
test_tick &&
git commit -m "added another file" &&
git format-patch --stdout master >lorem-move.patch
'
+ TERM=xterm
+ export TERM
+ case "$1" in
+ tput setaf 3
+ shift
+ echo '* expecting success:
echo hello >file &&
git add file &&
test_tick &&
! : &&
git commit -m first &&
git tag first &&
echo world >>file &&
git add file &&
test_tick &&
git commit -s -F msg &&
git tag second &&
git format-patch --stdout first >patch1 &&
sed -n -e "3,\$p" msg >file &&
git add file &&
test_tick &&
git commit -m third &&
git format-patch --stdout first >patch2 &&
git checkout -b lorem &&
sed -n -e "11,\$p" msg >file &&
head -n 9 msg >>file &&
test_tick &&
git commit -a -m "moved stuff" &&
echo goodbye >another &&
git add another &&
test_tick &&
git commit -m "added another file" &&
git format-patch --stdout master >lorem-move.patch
'
+ tput sgr0
+ test_run_ '
echo hello >file &&
git add file &&
test_tick &&
! : &&
git commit -m first &&
git tag first &&
echo world >>file &&
git add file &&
test_tick &&
git commit -s -F msg &&
git tag second &&
git format-patch --stdout first >patch1 &&
sed -n -e "3,\$p" msg >file &&
git add file &&
test_tick &&
git commit -m third &&
git format-patch --stdout first >patch2 &&
git checkout -b lorem &&
sed -n -e "11,\$p" msg >file &&
head -n 9 msg >>file &&
test_tick &&
git commit -a -m "moved stuff" &&
echo goodbye >another &&
git add another &&
test_tick &&
git commit -m "added another file" &&
git format-patch --stdout master >lorem-move.patch
'
+ eval '
echo hello >file &&
git add file &&
test_tick &&
! : &&
git commit -m first &&
git tag first &&
echo world >>file &&
git add file &&
test_tick &&
git commit -s -F msg &&
git tag second &&
git format-patch --stdout first >patch1 &&
sed -n -e "3,\$p" msg >file &&
git add file &&
test_tick &&
git commit -m third &&
git format-patch --stdout first >patch2 &&
git checkout -b lorem &&
sed -n -e "11,\$p" msg >file &&
head -n 9 msg >>file &&
test_tick &&
git commit -a -m "moved stuff" &&
echo goodbye >another &&
git add another &&
test_tick &&
git commit -m "added another file" &&
git format-patch --stdout master >lorem-move.patch
'
+ eval_ret=1
+ return 0
+ '[' 0 = 0 -a 1 = 0 ']'
+ test_failure_ setup '
echo hello >file &&
git add file &&
test_tick &&
! : &&
git commit -m first &&
git tag first &&
echo world >>file &&
git add file &&
test_tick &&
git commit -s -F msg &&
git tag second &&
git format-patch --stdout first >patch1 &&
sed -n -e "3,\$p" msg >file &&
git add file &&
test_tick &&
git commit -m third &&
git format-patch --stdout first >patch2 &&
git checkout -b lorem &&
sed -n -e "11,\$p" msg >file &&
head -n 9 msg >>file &&
test_tick &&
git commit -a -m "moved stuff" &&
echo goodbye >another &&
git add another &&
test_tick &&
git commit -m "added another file" &&
git format-patch --stdout master >lorem-move.patch
'
++ expr 0 + 1
+ test_count=1
++ expr 0 + 1
+ test_failure=1
+ say_color error 'FAIL 1: setup'
+ TERM=xterm
+ export TERM
+ case "$1" in
+ tput bold
+ tput setaf 1
+ shift
+ echo '* FAIL 1: setup'
+ tput sgr0
+ shift
+ echo '
echo hello >file &&
git add file &&
test_tick &&
! : &&
git commit -m first &&
git tag first &&
echo world >>file &&
git add file &&
test_tick &&
git commit -s -F msg &&
git tag second &&
git format-patch --stdout first >patch1 &&
sed -n -e "3,\$p" msg >file &&
git add file &&
test_tick &&
git commit -m third &&
git format-patch --stdout first >patch2 &&
git checkout -b lorem &&
sed -n -e "11,\$p" msg >file &&
head -n 9 msg >>file &&
test_tick &&
git commit -a -m "moved stuff" &&
echo goodbye >another &&
git add another &&
test_tick &&
git commit -m "added another file" &&
git format-patch --stdout master >lorem-move.patch
'
+ sed -e 's/^/ /'
+ test t = ''
+ trap - exit
+ exit 1
-------------
I want to see that the test failed at "! :" and I can't see that
on this output.
But perhaps I just have to reconfigure something, so that it will show me.
Regards,
Stephan
--
Stephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F
next prev parent reply other threads:[~2008-07-13 11:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-06 20:22 [HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite Stephan Beyer
2008-07-06 20:41 ` Johannes Schindelin
2008-07-07 14:08 ` Stephan Beyer
2008-07-07 14:41 ` Johannes Schindelin
2008-07-12 22:22 ` Stephan Beyer
2008-07-13 0:25 ` Johannes Schindelin
2008-07-13 11:09 ` Stephan Beyer [this message]
2008-07-13 13:21 ` Johannes Schindelin
2008-07-21 1:24 ` Stephan Beyer
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080713110904.GG22323@leksak.fem-net \
--to=s-beyer@gmx.net \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).