|
17 | 17 | # You should have received a copy of the GNU General Public License
|
18 | 18 | # along with this program. If not, see http://www.gnu.org/licenses/ .
|
19 | 19 |
|
20 |
| -# do the --tee work early; it otherwise confuses our careful |
21 |
| -# GIT_BUILD_DIR mangling |
22 |
| -case "$GIT_TEST_TEE_STARTED, $* " in |
23 |
| -done,*) |
24 |
| - # do not redirect again |
25 |
| - ;; |
26 |
| -*' --tee '*|*' --va'*) |
27 |
| - mkdir -p test-results |
28 |
| - BASE=test-results/$(basename "$0" .sh) |
29 |
| - (GIT_TEST_TEE_STARTED=done ${SHELL-sh} "$0" "$@" 2>&1; |
30 |
| - echo $? > $BASE.exit) | tee $BASE.out |
31 |
| - test "$(cat $BASE.exit)" = 0 |
32 |
| - exit |
33 |
| - ;; |
34 |
| -esac |
35 |
| - |
| 20 | +# These variables must be set before the inclusion of test-lib.sh below, |
| 21 | +# because it will change our working directory. |
36 | 22 | TEST_DIRECTORY=$(pwd)/..
|
37 | 23 | TEST_OUTPUT_DIRECTORY=$(pwd)
|
38 |
| -if test -z "$GIT_TEST_INSTALLED"; then |
39 |
| - perf_results_prefix= |
40 |
| -else |
41 |
| - perf_results_prefix=$(printf "%s" "${GIT_TEST_INSTALLED%/bin-wrappers}" | tr -c "[a-zA-Z0-9]" "[_*]")"." |
42 |
| - # make the tested dir absolute |
43 |
| - GIT_TEST_INSTALLED=$(cd "$GIT_TEST_INSTALLED" && pwd) |
44 |
| -fi |
| 24 | +ABSOLUTE_GIT_TEST_INSTALLED=$( |
| 25 | + test -n "$GIT_TEST_INSTALLED" && cd "$GIT_TEST_INSTALLED" && pwd) |
45 | 26 |
|
46 | 27 | TEST_NO_CREATE_REPO=t
|
47 | 28 | TEST_NO_MALLOC_CHECK=t
|
48 | 29 |
|
49 | 30 | . ../test-lib.sh
|
50 | 31 |
|
| 32 | +if test -z "$GIT_TEST_INSTALLED"; then |
| 33 | + perf_results_prefix= |
| 34 | +else |
| 35 | + perf_results_prefix=$(printf "%s" "${GIT_TEST_INSTALLED%/bin-wrappers}" | tr -c "[a-zA-Z0-9]" "[_*]")"." |
| 36 | + GIT_TEST_INSTALLED=$ABSOLUTE_GIT_TEST_INSTALLED |
| 37 | +fi |
| 38 | + |
51 | 39 | # Variables from test-lib that are normally internal to the tests; we
|
52 | 40 | # need to export them for test_perf subshells
|
53 | 41 | export TEST_DIRECTORY TRASH_DIRECTORY GIT_BUILD_DIR GIT_TEST_CMP
|
|
0 commit comments