summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRamkumar Ramachandra <artagnon@gmail.com>2012-09-22 10:25:10 +0530
committerJunio C Hamano <gitster@pobox.com>2012-09-25 10:17:29 -0700
commit4cde519fe666af478be4b86659c518949a853f91 (patch)
treef8a727debf153fc19bba8ea852167a75feb03128
parent889d35899ba64640e47798681ecb34a4be043bad (diff)
downloadgit-4cde519fe666af478be4b86659c518949a853f91.tar.gz
test-lib: use $SHELL_PATH, not $SHELL
The codepath for handling "--tee" ends up relaunching the test script under a shell, and that one has to be a Bourne. But we incorrectly used $SHELL, which could be a non-Bourne (e.g. zsh or csh); we have the Makefile variable $SHELL_PATH for exactly that, so use it instead. Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--t/test-lib.sh32
1 files changed, 16 insertions, 16 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index bb4f8865b2..49d8b21d2d 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -15,22 +15,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see http://www.gnu.org/licenses/ .
-# if --tee was passed, write the output not only to the terminal, but
-# additionally to the file test-results/$BASENAME.out, too.
-case "$GIT_TEST_TEE_STARTED, $* " in
-done,*)
- # do not redirect again
- ;;
-*' --tee '*|*' --va'*)
- mkdir -p test-results
- BASE=test-results/$(basename "$0" .sh)
- (GIT_TEST_TEE_STARTED=done ${SHELL-sh} "$0" "$@" 2>&1;
- echo $? > $BASE.exit) | tee $BASE.out
- test "$(cat $BASE.exit)" = 0
- exit
- ;;
-esac
-
# Keep the original TERM for say_color
ORIGINAL_TERM=$TERM
@@ -54,6 +38,22 @@ GIT_BUILD_DIR="$TEST_DIRECTORY"/..
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
export PERL_PATH SHELL_PATH
+# if --tee was passed, write the output not only to the terminal, but
+# additionally to the file test-results/$BASENAME.out, too.
+case "$GIT_TEST_TEE_STARTED, $* " in
+done,*)
+ # do not redirect again
+ ;;
+*' --tee '*|*' --va'*)
+ mkdir -p test-results
+ BASE=test-results/$(basename "$0" .sh)
+ (GIT_TEST_TEE_STARTED=done ${SHELL_PATH} "$0" "$@" 2>&1;
+ echo $? > $BASE.exit) | tee $BASE.out
+ test "$(cat $BASE.exit)" = 0
+ exit
+ ;;
+esac
+
# For repeatability, reset the environment to known value.
LANG=C
LC_ALL=C