From: Junio C Hamano Date: Fri, 10 Feb 2012 22:07:42 +0000 (-0800) Subject: Merge branch 'jk/tests-write-script' X-Git-Tag: v1.7.10-rc0~112 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/e06ed3ed8a72cadb2c3f9695825c827c1584549d?hp=-c Merge branch 'jk/tests-write-script' * jk/tests-write-script: t0300: use write_script helper tests: add write_script helper function --- e06ed3ed8a72cadb2c3f9695825c827c1584549d diff --combined t/test-lib.sh index b22bee7c84,a089a18864..e28d5fdebe --- a/t/test-lib.sh +++ b/t/test-lib.sh @@@ -64,8 -64,7 +64,8 @@@ GIT_AUTHOR_NAME='A U Thor GIT_COMMITTER_EMAIL=committer@example.com GIT_COMMITTER_NAME='C O Mitter' GIT_MERGE_VERBOSITY=5 -export GIT_MERGE_VERBOSITY +GIT_MERGE_AUTOEDIT=no +export GIT_MERGE_VERBOSITY GIT_MERGE_AUTOEDIT export GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME export GIT_COMMITTER_EMAIL GIT_COMMITTER_NAME export EDITOR @@@ -330,19 -329,6 +330,19 @@@ test_tick () export GIT_COMMITTER_DATE GIT_AUTHOR_DATE } +# Stop execution and start a shell. This is useful for debugging tests and +# only makes sense together with "-v". +# +# Be sure to remove all invocations of this command before submitting. + +test_pause () { + if test "$verbose" = t; then + "$SHELL_PATH" <&6 >&3 2>&4 + else + error >&5 "test_pause requires --verbose" + fi +} + # Call test_commit with the arguments " [ []]" # # This will commit a file with the given contents and the given commit @@@ -395,11 -381,20 +395,20 @@@ test_config () git config "$@" } + test_config_global () { test_when_finished "test_unconfig --global '$1'" && git config --global "$@" } + write_script () { + { + echo "#!${2-"$SHELL_PATH"}" && + cat + } >"$1" && + chmod +x "$1" + } + # Use test_set_prereq to tell that a particular prerequisite is available. # The prerequisite can later be checked for in two ways: #