Skip to content

Commit ff3ec8a

Browse files
committed
Merge branch 'rr/test-use-shell-path-not-shell' into maint
* rr/test-use-shell-path-not-shell: test-lib: use $SHELL_PATH, not $SHELL
2 parents 5178ee1 + 4cde519 commit ff3ec8a

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

t/test-lib.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,6 @@
1515
# You should have received a copy of the GNU General Public License
1616
# along with this program. If not, see http://www.gnu.org/licenses/ .
1717

18-
# if --tee was passed, write the output not only to the terminal, but
19-
# additionally to the file test-results/$BASENAME.out, too.
20-
case "$GIT_TEST_TEE_STARTED, $* " in
21-
done,*)
22-
# do not redirect again
23-
;;
24-
*' --tee '*|*' --va'*)
25-
mkdir -p test-results
26-
BASE=test-results/$(basename "$0" .sh)
27-
(GIT_TEST_TEE_STARTED=done ${SHELL-sh} "$0" "$@" 2>&1;
28-
echo $? > $BASE.exit) | tee $BASE.out
29-
test "$(cat $BASE.exit)" = 0
30-
exit
31-
;;
32-
esac
33-
3418
# Keep the original TERM for say_color
3519
ORIGINAL_TERM=$TERM
3620

@@ -63,6 +47,22 @@ fi
6347
. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS
6448
export PERL_PATH SHELL_PATH
6549

50+
# if --tee was passed, write the output not only to the terminal, but
51+
# additionally to the file test-results/$BASENAME.out, too.
52+
case "$GIT_TEST_TEE_STARTED, $* " in
53+
done,*)
54+
# do not redirect again
55+
;;
56+
*' --tee '*|*' --va'*)
57+
mkdir -p test-results
58+
BASE=test-results/$(basename "$0" .sh)
59+
(GIT_TEST_TEE_STARTED=done ${SHELL_PATH} "$0" "$@" 2>&1;
60+
echo $? > $BASE.exit) | tee $BASE.out
61+
test "$(cat $BASE.exit)" = 0
62+
exit
63+
;;
64+
esac
65+
6666
# For repeatability, reset the environment to known value.
6767
LANG=C
6868
LC_ALL=C

0 commit comments

Comments
 (0)