{"thread":{"id":"14313","subject":"[HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.","startedAt":"2008-07-06T20:22:31Z","lastAt":"2008-07-21T01:24:38Z","messageCount":9,"participants":["Stephan Beyer","Johannes Schindelin"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"82388","messageId":"1215375751-30853-1-git-send-email-s-beyer@gmx.net","threadId":"14313","inReplyTo":null,"subject":"[HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-06T20:22:31Z","receivedAt":"2008-07-06T20:22:31Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"This option realizes a stupid hack that tries to run the test\ncases line by line (separated by &&).\nFurthermore it shows the line it is testing.\nWith that information it is easier to find the reason\nwhy a test fails.\n\nThis hack works as long as there are no multi-line\nfor/while/subshell/... in the test cases.\n\nNote, that the -s option should only be used if a test case failed.\nIt is slow and error-prone.\n\nSigned-off-by: Stephan Beyer <s-beyer@gmx.net>\n---\nHi,\n\nI wrote that before I started to make the sequencer prototype and\nthen I used this hack more than expected ;-)\nToday I cherry-picked this commit into another branch and then\nI thought this could be useful for others, too.\n(Explicitly not for inclusion!)\n\nSo how to use it?\nWhen running a test case in t/, add the -s option and then it shows\nsomething like this:\n\n--snip--[...]\n\n-------\nTesting:\n        ! test -d \"$SEQDIR\"\n\n-------\nTesting:\n        session_ok\n\n* FAIL 3: \"pick\", \"squash\", \"ref\" from stdin\n\n                next_session squashCE &&\n                valgrind git sequencer <todotest1 &&\n                ! test -d \"$SEQDIR\" &&\n                session_ok &&\n                test -f file2 &&\n                test -f file3 &&\n                test $(git rev-parse CE) = $(git rev-parse HEAD) &&\n                test $(git rev-parse I) = $(git rev-parse HEAD^)\n--snap--\n\nBecause of the \"Testing:\" lines you can explicitly see where it failed.\n\nRegards,\n  Stephan\n\n t/test-lib.sh |   45 +++++++++++++++++++++++++++++++++++++++++++--\n 1 files changed, 43 insertions(+), 2 deletions(-)\n\ndiff --git a/t/test-lib.sh b/t/test-lib.sh\nindex c0c5e0e..6f42106 100644\n--- a/t/test-lib.sh\n+++ b/t/test-lib.sh\n@@ -86,6 +86,8 @@ do\n \t\thelp=t; shift ;;\n \t-v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)\n \t\tverbose=t; shift ;;\n+\t-s|--show-hack)\n+\t\tverbose=t; show_hack=t; immediate=t; shift ;;\n \t-q|--q|--qu|--qui|--quie|--quiet)\n \t\tquiet=t; shift ;;\n \t--no-color)\n@@ -225,9 +227,48 @@ test_debug () {\n \ttest \"$debug\" = \"\" || eval \"$1\"\n }\n \n-test_run_ () {\n-\teval >&3 2>&4 \"$1\"\n+test_run__ () {\n+\teval \"$1\"\n \teval_ret=\"$?\"\n+}\n+\n+test_run_op_ () {\n+\techo \"Testing:\"\n+\tprintf \"%s\\n\" \"$op_\"\n+\techo\n+\teval \"$op_\"\n+\teval_ret=\"$?\"\n+}\n+\n+test_run_hack_ () {\n+\ti_=1\n+\tj_=1\n+\ttotal_=$(printf '%s' \"$1\" | wc -l)\n+\twhile test \"$j_\" -lt $(expr \"$total_\" + 1)\n+\tdo\n+\t\top_=$(printf '%s' \"$1\" | sed -n -e \"$i_,$j_ p\")\n+\t\tif test -n \"$(printf '%s' \"$op_\" | sed -n -e '/<<[-\\\\ A-Za-z]/q;/&& *$/p;')\"\n+\t\tthen\n+\t\t\ti_=$(expr \"$j_\" + 1)\n+\t\t\top_=$(printf '%s' \"$op_\" | sed -e 's/ *&& *$//')\n+\t\t\ttest_run_op_\n+\t\t\ttest \"$eval_ret\" -ne 0 && return 0\n+\t\t\techo -------\n+\t\tfi\n+\t\tj_=$(expr \"$j_\" + 1)\n+\tdone\n+\top_=\"$(printf '%s' \"$1\" | sed -n -e \"$i_,$j_ p\")\"\n+\ttest_run_op_\n+\treturn 0\n+}\n+\n+test_run_ () {\n+\tif test -z \"$show_hack\"\n+\tthen\n+\t\ttest_run__ >&3 2>&4 \"$1\"\n+\telse\n+\t\ttest_run_hack_ >&3 2>&4 \"$1\"\n+\tfi\n \treturn 0\n }\n \n-- \n1.5.6.363.g7ba71\n"},{"id":"82391","messageId":"alpine.DEB.1.00.0807062241040.7342@eeepc-johanness","threadId":"14313","inReplyTo":"1215375751-30853-1-git-send-email-s-beyer@gmx.net","subject":"Re: [HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-06T20:41:40Z","receivedAt":"2008-07-06T20:41:40Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 6 Jul 2008, Stephan Beyer wrote:\n\n> This option realizes a stupid hack that tries to run the test\n> cases line by line (separated by &&).\n\nIn what way is that better than \"sh -x t????-*.sh\"?\n\nCiao,\nDscho\n"},{"id":"82448","messageId":"20080707140841.GB6726@leksak.fem-net","threadId":"14313","inReplyTo":"alpine.DEB.1.00.0807062241040.7342@eeepc-johanness","subject":"Re: [HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-07T14:08:41Z","receivedAt":"2008-07-07T14:08:41Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\n> > This option realizes a stupid hack that tries to run the test\n> > cases line by line (separated by &&).\n> \n> In what way is that better than \"sh -x t????-*.sh\"?\n\nYour suggestion is more like \"./t????-*.sh -v\" instead of -s, at least\non bash and dash here.\nBut I didn't know the -x flag and it seems that this could be used in\ntest-lib.sh to make the hack faster, more robust and less hacky ;-)\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"82455","messageId":"alpine.DEB.1.00.0807071540310.18205@racer","threadId":"14313","inReplyTo":"20080707140841.GB6726@leksak.fem-net","subject":"Re: [HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-07T14:41:41Z","receivedAt":"2008-07-07T14:41:41Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 7 Jul 2008, Stephan Beyer wrote:\n\n> > > This option realizes a stupid hack that tries to run the test cases \n> > > line by line (separated by &&).\n> > \n> > In what way is that better than \"sh -x t????-*.sh\"?\n> \n> Your suggestion is more like \"./t????-*.sh -v\" instead of -s, at least\n> on bash and dash here.\n\nNo, I meant without \"-v\".\n\n> But I didn't know the -x flag and it seems that this could be used in \n> test-lib.sh to make the hack faster, more robust and less hacky ;-)\n\nIt would obsolete your hack, I suggest.  Obviously, you haven't tried it \nyet.\n\nHth,\nDscho\n"},{"id":"83108","messageId":"20080712222212.GC22323@leksak.fem-net","threadId":"14313","inReplyTo":"alpine.DEB.1.00.0807071540310.18205@racer","subject":"Re: [HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-12T22:22:12Z","receivedAt":"2008-07-12T22:22:12Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nI'm just cleaning up my inbox and I've seen I've not yet replied to your\nmail.\n\nJohannes Schindelin wrote:\n> Hi,\n> \n> On Mon, 7 Jul 2008, Stephan Beyer wrote:\n> \n> > > > This option realizes a stupid hack that tries to run the test cases \n> > > > line by line (separated by &&).\n> > > \n> > > In what way is that better than \"sh -x t????-*.sh\"?\n> > \n> > Your suggestion is more like \"./t????-*.sh -v\" instead of -s, at least\n> > on bash and dash here.\n> \n> No, I meant without \"-v\".\n\nMe, too.\n\nI've written something different:\n\"sh -x\" is a great thing and does exactly what it should on simple scripts\ncontaining:\n\n\tfoo &&\n\tbar &&\n\tbaz\n\nBut for a test case in the git test suite it does not work, unfortunately.\n(Tested on bash, dash and zsh.)\n\nThe information I get from\n\tsh -x ./t????-*.sh\nis like the information I get from invoking\n\t./t????-*.sh -v\nbut less eye-pleasing.\nAnd ./t????-*.sh -s (using this patch) shows me something like:\n\n\tTesting:\n\t\tfoo\n\n\tTesting:\n\t\tbar\n\n\t* FAIL: blabla\n\nSo that I what *command* of the test case fails.\n\nBut perhaps I am just doing something wrong.\n\n> > But I didn't know the -x flag and it seems that this could be used in \n> > test-lib.sh to make the hack faster, more robust and less hacky ;-)\n> \n> It would obsolete your hack, I suggest.  Obviously, you haven't tried it \n> yet.\n\nThe obvious is wrong.\n\nI would be very happy to obsolete my slow and error-prone hack, but\ncurrently I have not seen a good alternative.\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"83114","messageId":"alpine.DEB.1.00.0807130222320.2995@eeepc-johanness","threadId":"14313","inReplyTo":"20080712222212.GC22323@leksak.fem-net","subject":"Re: [HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-13T00:25:22Z","receivedAt":"2008-07-13T00:25:22Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 13 Jul 2008, Stephan Beyer wrote:\n\n> Johannes Schindelin wrote:\n> \n> > On Mon, 7 Jul 2008, Stephan Beyer wrote:\n> > \n> > > > > This option realizes a stupid hack that tries to run the test \n> > > > > cases line by line (separated by &&).\n> > > > \n> > > > In what way is that better than \"sh -x t????-*.sh\"?\n> > > \n> > > Your suggestion is more like \"./t????-*.sh -v\" instead of -s, at \n> > > least on bash and dash here.\n> > \n> > No, I meant without \"-v\".\n> \n> Me, too.\n> \n> I've written something different: \"sh -x\" is a great thing and does \n> exactly what it should on simple scripts containing:\n> \n> \tfoo &&\n> \tbar &&\n> \tbaz\n> \n> But for a test case in the git test suite it does not work, unfortunately.\n\nHuh?\n\nWhen I run \"sh -x t*.sh\", it lists _every_ command that was executed in \nthe script, and even more: it shows me the result, too!  If there was a \nfunction that was called, it prefixes an additional \"+\" so that I can \nfollow recursion better.\n\nAll in all, \"sh -x\" is a very versatile tool.\n\nAs far as I undertood your commit message, your HACK would have done the \nfirst part: list what commands were executed.  This is less than what \"sh \n-x\" does.\n\nPlease clarify,\nDscho\n"},{"id":"83134","messageId":"20080713110904.GG22323@leksak.fem-net","threadId":"14313","inReplyTo":"alpine.DEB.1.00.0807130222320.2995@eeepc-johanness","subject":"Re: [HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-13T11:09:05Z","receivedAt":"2008-07-13T11:09:05Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nJohannes Schindelin wrote:\n[...]\n> \n> Please clarify,\n> Dscho\n\nOk, I add an example and show you what my output is using sh -x and my\nhack. Perhaps you can point me to something that wents wrong.\n\nFirst I make t4150 fail:\n\ndiff --git a/t/t4150-am.sh b/t/t4150-am.sh\nindex bc98260..07e626a 100755\n--- a/t/t4150-am.sh\n+++ b/t/t4150-am.sh\n@@ -69,6 +69,7 @@ test_expect_success setup '\n \techo hello >file &&\n \tgit add file &&\n \ttest_tick &&\n+\t! : &&\n \tgit commit -m first &&\n \tgit tag first &&\n \techo world >>file &&\n\nNow:\n\n-------------\n$ ./t4150-am.sh -s\nInitialized empty Git repository in /home/sbeyer/src/git/t/trash directory/.git/\n* expecting success:\n        echo hello >file &&\n        git add file &&\n        test_tick &&\n        ! : &&\n        git commit -m first &&\n        git tag first &&\n        echo world >>file &&\n        git add file &&\n        test_tick &&\n        git commit -s -F msg &&\n        git tag second &&\n        git format-patch --stdout first >patch1 &&\n        sed -n -e \"3,\\$p\" msg >file &&\n        git add file &&\n        test_tick &&\n        git commit -m third &&\n        git format-patch --stdout first >patch2 &&\n        git checkout -b lorem &&\n        sed -n -e \"11,\\$p\" msg >file &&\n        head -n 9 msg >>file &&\n        test_tick &&\n        git commit -a -m \"moved stuff\" &&\n        echo goodbye >another &&\n        git add another &&\n        test_tick &&\n        git commit -m \"added another file\" &&\n        git format-patch --stdout master >lorem-move.patch\n\nTesting:\n\n        echo hello >file\n\n-------\nTesting:\n        git add file\n\n-------\nTesting:\n        test_tick\n\n-------\nTesting:\n        ! :\n\n* FAIL 1: setup\n\n                echo hello >file &&\n                git add file &&\n                test_tick &&\n                ! : &&\n                git commit -m first &&\n                git tag first &&\n                echo world >>file &&\n                git add file &&\n                test_tick &&\n                git commit -s -F msg &&\n                git tag second &&\n                git format-patch --stdout first >patch1 &&\n                sed -n -e \"3,\\$p\" msg >file &&\n                git add file &&\n                test_tick &&\n                git commit -m third &&\n                git format-patch --stdout first >patch2 &&\n                git checkout -b lorem &&\n                sed -n -e \"11,\\$p\" msg >file &&\n                head -n 9 msg >>file &&\n                test_tick &&\n                git commit -a -m \"moved stuff\" &&\n                echo goodbye >another &&\n                git add another &&\n                test_tick &&\n                git commit -m \"added another file\" &&\n                git format-patch --stdout master >lorem-move.patch\n\n-------------\n\n\nAnd now sh -x:\n\n-------------\n$ sh --version\nGNU bash, version 3.2.39(1)-release (x86_64-pc-linux-gnu)\nCopyright (C) 2007 Free Software Foundation, Inc.\n$ # no big differences using dash or zsh\n$ sh -x ./t4150-am.sh -i\n+ test_description='git am running'\n+ . ./test-lib.sh\n++ ORIGINAL_TERM=xterm\n++ LANG=C\n++ LC_ALL=C\n++ PAGER=cat\n++ TZ=UTC\n++ TERM=dumb\n++ export LANG LC_ALL PAGER TERM TZ\n++ EDITOR=:\n++ VISUAL=:\n++ unset GIT_EDITOR\n++ unset AUTHOR_DATE\n++ unset AUTHOR_EMAIL\n++ unset AUTHOR_NAME\n++ unset COMMIT_AUTHOR_EMAIL\n++ unset COMMIT_AUTHOR_NAME\n++ unset EMAIL\n++ unset GIT_ALTERNATE_OBJECT_DIRECTORIES\n++ unset GIT_AUTHOR_DATE\n++ GIT_AUTHOR_EMAIL=author@example.com\n++ GIT_AUTHOR_NAME='A U Thor'\n++ unset GIT_COMMITTER_DATE\n++ GIT_COMMITTER_EMAIL=committer@example.com\n++ GIT_COMMITTER_NAME='C O Mitter'\n++ unset GIT_DIFF_OPTS\n++ unset GIT_DIR\n++ unset GIT_WORK_TREE\n++ unset GIT_EXTERNAL_DIFF\n++ unset GIT_INDEX_FILE\n++ unset GIT_OBJECT_DIRECTORY\n++ unset GIT_CEILING_DIRECTORIES\n++ unset SHA1_FILE_DIRECTORIES\n++ unset SHA1_FILE_DIRECTORY\n++ GIT_MERGE_VERBOSITY=5\n++ export GIT_MERGE_VERBOSITY\n++ export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME\n++ export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME\n++ export EDITOR VISUAL\n++ GIT_TEST_CMP='diff -u'\n++ unset CDPATH\n++ case $(echo $GIT_TRACE |tr \"[A-Z]\" \"[a-z]\") in\n+++ echo\n+++ tr '[A-Z]' '[a-z]'\n++ '[' xxterm '!=' xdumb ']'\n++ TERM=xterm\n++ export TERM\n++ '[' -t 1 ']'\n++ tput bold\n++ tput setaf 1\n++ tput sgr0\n++ color=t\n++ test 1 -ne 0\n++ case \"$1\" in\n++ immediate=t\n++ shift\n++ test 0 -ne 0\n++ test -n t\n++ test 'git am running' '!=' ''\n++ test '' = t\n++ exec\n++ test '' = t\n++ exec\n++ test_failure=0\n++ test_count=0\n++ test_fixed=0\n++ test_broken=0\n++ test_success=0\n++ trap die exit\n+++ pwd\n++ TEST_DIRECTORY=/home/sbeyer/src/git/t\n++ PATH=/home/sbeyer/src/git/t/..:/home/sbeyer/bin/:/usr/local/bin:/usr/bin:/bin:/usr/games\n+++ pwd\n++ GIT_EXEC_PATH=/home/sbeyer/src/git/t/..\n+++ pwd\n++ GIT_TEMPLATE_DIR=/home/sbeyer/src/git/t/../templates/blt\n++ unset GIT_CONFIG\n++ unset GIT_CONFIG_LOCAL\n++ GIT_CONFIG_NOSYSTEM=1\n++ GIT_CONFIG_NOGLOBAL=1\n++ export PATH GIT_EXEC_PATH GIT_TEMPLATE_DIR GIT_CONFIG_NOSYSTEM GIT_CONFIG_NOGLOBAL\n+++ pwd\n+++ pwd\n++ GITPERLLIB=/home/sbeyer/src/git/t/../perl/blib/lib:/home/sbeyer/src/git/t/../perl/blib/arch/auto/Git\n++ export GITPERLLIB\n++ test -d ../templates/blt\n++ test -x ../test-chmtime\n++ . ../GIT-BUILD-OPTIONS\n+++ SHELL_PATH=/bin/sh\n++ test='trash directory'\n++ rm -fr 'trash directory'\n++ test_create_repo 'trash directory'\n++ test 1 = 1\n+++ pwd\n++ owd=/home/sbeyer/src/git/t\n++ repo='trash directory'\n++ mkdir 'trash directory'\n++ cd 'trash directory'\n++ /home/sbeyer/src/git/t/../git init --template=/home/sbeyer/src/git/t/../templates/blt/\n++ mv .git/hooks .git/hooks-disabled\n++ cd /home/sbeyer/src/git/t\n++ cd -P 'trash directory'\n+++ expr ././t4150-am.sh : '.*/\\(t[0-9]*\\)-[^/]*$'\n++ this_test=t4150\n+ cat\n+ cat\n+ cat\n+ echo 'Signed-off-by: C O Mitter <committer@example.com>'\n+ test_expect_success setup '\n\techo hello >file &&\n\tgit add file &&\n\ttest_tick &&\n\t! : &&\n\tgit commit -m first &&\n\tgit tag first &&\n\techo world >>file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -s -F msg &&\n\tgit tag second &&\n\tgit format-patch --stdout first >patch1 &&\n\tsed -n -e \"3,\\$p\" msg >file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -m third &&\n\tgit format-patch --stdout first >patch2\t&&\n\tgit checkout -b lorem &&\n\tsed -n -e \"11,\\$p\" msg >file &&\n\thead -n 9 msg >>file &&\n\ttest_tick &&\n\tgit commit -a -m \"moved stuff\" &&\n\techo goodbye >another &&\n\tgit add another &&\n\ttest_tick &&\n\tgit commit -m \"added another file\" &&\n\tgit format-patch --stdout master >lorem-move.patch\n'\n+ test 2 = 2\n+ test_skip setup '\n\techo hello >file &&\n\tgit add file &&\n\ttest_tick &&\n\t! : &&\n\tgit commit -m first &&\n\tgit tag first &&\n\techo world >>file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -s -F msg &&\n\tgit tag second &&\n\tgit format-patch --stdout first >patch1 &&\n\tsed -n -e \"3,\\$p\" msg >file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -m third &&\n\tgit format-patch --stdout first >patch2\t&&\n\tgit checkout -b lorem &&\n\tsed -n -e \"11,\\$p\" msg >file &&\n\thead -n 9 msg >>file &&\n\ttest_tick &&\n\tgit commit -a -m \"moved stuff\" &&\n\techo goodbye >another &&\n\tgit add another &&\n\ttest_tick &&\n\tgit commit -m \"added another file\" &&\n\tgit format-patch --stdout master >lorem-move.patch\n'\n++ expr ././t4150-am.sh : '.*/\\(t[0-9]*\\)-[^/]*$'\n+ this_test=t4150\n++ expr 0 + 1\n+ this_test=t4150.1\n+ to_skip=\n+ case \"$to_skip\" in\n+ false\n+ say 'expecting success: \n\techo hello >file &&\n\tgit add file &&\n\ttest_tick &&\n\t! : &&\n\tgit commit -m first &&\n\tgit tag first &&\n\techo world >>file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -s -F msg &&\n\tgit tag second &&\n\tgit format-patch --stdout first >patch1 &&\n\tsed -n -e \"3,\\$p\" msg >file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -m third &&\n\tgit format-patch --stdout first >patch2\t&&\n\tgit checkout -b lorem &&\n\tsed -n -e \"11,\\$p\" msg >file &&\n\thead -n 9 msg >>file &&\n\ttest_tick &&\n\tgit commit -a -m \"moved stuff\" &&\n\techo goodbye >another &&\n\tgit add another &&\n\ttest_tick &&\n\tgit commit -m \"added another file\" &&\n\tgit format-patch --stdout master >lorem-move.patch\n'\n+ say_color info 'expecting success: \n\techo hello >file &&\n\tgit add file &&\n\ttest_tick &&\n\t! : &&\n\tgit commit -m first &&\n\tgit tag first &&\n\techo world >>file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -s -F msg &&\n\tgit tag second &&\n\tgit format-patch --stdout first >patch1 &&\n\tsed -n -e \"3,\\$p\" msg >file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -m third &&\n\tgit format-patch --stdout first >patch2\t&&\n\tgit checkout -b lorem &&\n\tsed -n -e \"11,\\$p\" msg >file &&\n\thead -n 9 msg >>file &&\n\ttest_tick &&\n\tgit commit -a -m \"moved stuff\" &&\n\techo goodbye >another &&\n\tgit add another &&\n\ttest_tick &&\n\tgit commit -m \"added another file\" &&\n\tgit format-patch --stdout master >lorem-move.patch\n'\n+ TERM=xterm\n+ export TERM\n+ case \"$1\" in\n+ tput setaf 3\n+ shift\n+ echo '* expecting success: \n\techo hello >file &&\n\tgit add file &&\n\ttest_tick &&\n\t! : &&\n\tgit commit -m first &&\n\tgit tag first &&\n\techo world >>file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -s -F msg &&\n\tgit tag second &&\n\tgit format-patch --stdout first >patch1 &&\n\tsed -n -e \"3,\\$p\" msg >file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -m third &&\n\tgit format-patch --stdout first >patch2\t&&\n\tgit checkout -b lorem &&\n\tsed -n -e \"11,\\$p\" msg >file &&\n\thead -n 9 msg >>file &&\n\ttest_tick &&\n\tgit commit -a -m \"moved stuff\" &&\n\techo goodbye >another &&\n\tgit add another &&\n\ttest_tick &&\n\tgit commit -m \"added another file\" &&\n\tgit format-patch --stdout master >lorem-move.patch\n'\n+ tput sgr0\n+ test_run_ '\n\techo hello >file &&\n\tgit add file &&\n\ttest_tick &&\n\t! : &&\n\tgit commit -m first &&\n\tgit tag first &&\n\techo world >>file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -s -F msg &&\n\tgit tag second &&\n\tgit format-patch --stdout first >patch1 &&\n\tsed -n -e \"3,\\$p\" msg >file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -m third &&\n\tgit format-patch --stdout first >patch2\t&&\n\tgit checkout -b lorem &&\n\tsed -n -e \"11,\\$p\" msg >file &&\n\thead -n 9 msg >>file &&\n\ttest_tick &&\n\tgit commit -a -m \"moved stuff\" &&\n\techo goodbye >another &&\n\tgit add another &&\n\ttest_tick &&\n\tgit commit -m \"added another file\" &&\n\tgit format-patch --stdout master >lorem-move.patch\n'\n+ eval '\n\techo hello >file &&\n\tgit add file &&\n\ttest_tick &&\n\t! : &&\n\tgit commit -m first &&\n\tgit tag first &&\n\techo world >>file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -s -F msg &&\n\tgit tag second &&\n\tgit format-patch --stdout first >patch1 &&\n\tsed -n -e \"3,\\$p\" msg >file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -m third &&\n\tgit format-patch --stdout first >patch2\t&&\n\tgit checkout -b lorem &&\n\tsed -n -e \"11,\\$p\" msg >file &&\n\thead -n 9 msg >>file &&\n\ttest_tick &&\n\tgit commit -a -m \"moved stuff\" &&\n\techo goodbye >another &&\n\tgit add another &&\n\ttest_tick &&\n\tgit commit -m \"added another file\" &&\n\tgit format-patch --stdout master >lorem-move.patch\n'\n+ eval_ret=1\n+ return 0\n+ '[' 0 = 0 -a 1 = 0 ']'\n+ test_failure_ setup '\n\techo hello >file &&\n\tgit add file &&\n\ttest_tick &&\n\t! : &&\n\tgit commit -m first &&\n\tgit tag first &&\n\techo world >>file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -s -F msg &&\n\tgit tag second &&\n\tgit format-patch --stdout first >patch1 &&\n\tsed -n -e \"3,\\$p\" msg >file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -m third &&\n\tgit format-patch --stdout first >patch2\t&&\n\tgit checkout -b lorem &&\n\tsed -n -e \"11,\\$p\" msg >file &&\n\thead -n 9 msg >>file &&\n\ttest_tick &&\n\tgit commit -a -m \"moved stuff\" &&\n\techo goodbye >another &&\n\tgit add another &&\n\ttest_tick &&\n\tgit commit -m \"added another file\" &&\n\tgit format-patch --stdout master >lorem-move.patch\n'\n++ expr 0 + 1\n+ test_count=1\n++ expr 0 + 1\n+ test_failure=1\n+ say_color error 'FAIL 1: setup'\n+ TERM=xterm\n+ export TERM\n+ case \"$1\" in\n+ tput bold\n+ tput setaf 1\n+ shift\n+ echo '* FAIL 1: setup'\n+ tput sgr0\n+ shift\n+ echo '\n\techo hello >file &&\n\tgit add file &&\n\ttest_tick &&\n\t! : &&\n\tgit commit -m first &&\n\tgit tag first &&\n\techo world >>file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -s -F msg &&\n\tgit tag second &&\n\tgit format-patch --stdout first >patch1 &&\n\tsed -n -e \"3,\\$p\" msg >file &&\n\tgit add file &&\n\ttest_tick &&\n\tgit commit -m third &&\n\tgit format-patch --stdout first >patch2\t&&\n\tgit checkout -b lorem &&\n\tsed -n -e \"11,\\$p\" msg >file &&\n\thead -n 9 msg >>file &&\n\ttest_tick &&\n\tgit commit -a -m \"moved stuff\" &&\n\techo goodbye >another &&\n\tgit add another &&\n\ttest_tick &&\n\tgit commit -m \"added another file\" &&\n\tgit format-patch --stdout master >lorem-move.patch\n'\n+ sed -e 's/^/\t/'\n+ test t = ''\n+ trap - exit\n+ exit 1\n-------------\n\nI want to see that the test failed at \"! :\" and I can't see that\non this output.\n\nBut perhaps I just have to reconfigure something, so that it will show me.\n\nRegards,\n  Stephan\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"},{"id":"83149","messageId":"alpine.DEB.1.00.0807131518370.4816@eeepc-johanness","threadId":"14313","inReplyTo":"20080713110904.GG22323@leksak.fem-net","subject":"Re: [HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2008-07-13T13:21:36Z","receivedAt":"2008-07-13T13:21:36Z","isPatch":false,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Sun, 13 Jul 2008, Stephan Beyer wrote:\n\n> I want to see that the test failed at \"! :\" and I can't see that\n> on this output.\n> \n> But perhaps I just have to reconfigure something, so that it will show \n> me.\n\nAh, I implicitely assumed that you would also pass the \"-i -v\" flags to \nthe test script, as my fingers are already trained to do so whenever I \ncall a test script:\n\n$ sh -x t4150-am.sh -i -v\n\nYou will have to scroll back a few lines to see exactly what failed, but \nyou will see the exact commands (also of functions that were called), \ntogether with their return values (i.e. what the function output, and what \nwas assigned to variables).\n\nAll that using the screen estate much more cautiously than your output.\n\nI use \"sh -x t* -i -v\" all the time,\nDscho\n"},{"id":"84125","messageId":"20080721012438.GF5950@leksak.fem-net","threadId":"14313","inReplyTo":"alpine.DEB.1.00.0807131518370.4816@eeepc-johanness","subject":"Re: [HACK] t/test-lib.sh HACK: Add -s/--show-hack to test suite.","fromName":"Stephan Beyer","fromEmail":"s-beyer@gmx.net","sentAt":"2008-07-21T01:24:38Z","receivedAt":"2008-07-21T01:24:38Z","isPatch":false,"sender":{"key":"s-beyer@gmx.net","avatar":"https://avatars.githubusercontent.com/u/143889?v=4"},"body":"Hi,\n\nJohannes Schindelin wrote:\n> You will have to scroll back a few lines to see exactly what failed, but \n> you will see the exact commands (also of functions that were called), \n> together with their return values (i.e. what the function output, and what \n> was assigned to variables).\n\nI've tested again and found it now. Thanks!\n\nIt's a littler harder to see, but now I know that I should look for\nthe last \"+ eval_ret=\" line, ...that makes it easier ;)\n\nPuh, now I can finally move this thread to the archives :)\n\nRegards.\n\n-- \nStephan Beyer <s-beyer@gmx.net>, PGP 0x6EDDD207FCC5040F\n"}]}