Merge branch 'jk/perf-lib-tee'
Code cleanup in the test framework. * jk/perf-lib-tee: perf-lib.sh: rely on test-lib.sh for --tee handling
This commit is contained in:
@ -17,37 +17,25 @@
|
|||||||
# You should have received a copy of the GNU General Public License
|
# You should have received a copy of the GNU General Public License
|
||||||
# along with this program. If not, see http://www.gnu.org/licenses/ .
|
# along with this program. If not, see http://www.gnu.org/licenses/ .
|
||||||
|
|
||||||
# do the --tee work early; it otherwise confuses our careful
|
# These variables must be set before the inclusion of test-lib.sh below,
|
||||||
# GIT_BUILD_DIR mangling
|
# because it will change our working directory.
|
||||||
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
|
|
||||||
|
|
||||||
TEST_DIRECTORY=$(pwd)/..
|
TEST_DIRECTORY=$(pwd)/..
|
||||||
TEST_OUTPUT_DIRECTORY=$(pwd)
|
TEST_OUTPUT_DIRECTORY=$(pwd)
|
||||||
if test -z "$GIT_TEST_INSTALLED"; then
|
ABSOLUTE_GIT_TEST_INSTALLED=$(
|
||||||
perf_results_prefix=
|
test -n "$GIT_TEST_INSTALLED" && cd "$GIT_TEST_INSTALLED" && pwd)
|
||||||
else
|
|
||||||
perf_results_prefix=$(printf "%s" "${GIT_TEST_INSTALLED%/bin-wrappers}" | tr -c "[a-zA-Z0-9]" "[_*]")"."
|
|
||||||
# make the tested dir absolute
|
|
||||||
GIT_TEST_INSTALLED=$(cd "$GIT_TEST_INSTALLED" && pwd)
|
|
||||||
fi
|
|
||||||
|
|
||||||
TEST_NO_CREATE_REPO=t
|
TEST_NO_CREATE_REPO=t
|
||||||
TEST_NO_MALLOC_CHECK=t
|
TEST_NO_MALLOC_CHECK=t
|
||||||
|
|
||||||
. ../test-lib.sh
|
. ../test-lib.sh
|
||||||
|
|
||||||
|
if test -z "$GIT_TEST_INSTALLED"; then
|
||||||
|
perf_results_prefix=
|
||||||
|
else
|
||||||
|
perf_results_prefix=$(printf "%s" "${GIT_TEST_INSTALLED%/bin-wrappers}" | tr -c "[a-zA-Z0-9]" "[_*]")"."
|
||||||
|
GIT_TEST_INSTALLED=$ABSOLUTE_GIT_TEST_INSTALLED
|
||||||
|
fi
|
||||||
|
|
||||||
# Variables from test-lib that are normally internal to the tests; we
|
# Variables from test-lib that are normally internal to the tests; we
|
||||||
# need to export them for test_perf subshells
|
# need to export them for test_perf subshells
|
||||||
export TEST_DIRECTORY TRASH_DIRECTORY GIT_BUILD_DIR GIT_TEST_CMP
|
export TEST_DIRECTORY TRASH_DIRECTORY GIT_BUILD_DIR GIT_TEST_CMP
|
||||||
|
Reference in New Issue
Block a user