summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e3df89a)
raw | patch | inline | side by side (parent: e3df89a)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Fri, 8 Aug 2008 11:08:37 +0000 (13:08 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 9 Aug 2008 05:24:28 +0000 (22:24 -0700) |
On multiprocessor machines, or with I/O heavy tests (that leave the
CPU waiting a lot), it makes sense to parallelize the tests.
However, care has to be taken that the different jobs use different
trash directories.
This commit does so, by creating the trash directories with a suffix
that is unique with regard to the test, as it is the test's base name.
Further, the trash directory is removed in the test itself if
everything went fine, so that the trash directories do not
pile up only to be removed at the very end.
If a test failed, the trash directory is not removed. Chances are
that the exact error message is lost in the clutter, but you can still
see what test failed from the name of the trash directory, and repeat
the test (without -j).
If all was good, you will see the aggregated results.
Suggestions to simplify this commit came from Junio and René.
There still is an issue with tests that want to run a server process and
listen to a fixed port (http and svn) --- they cannot run in parallel but
this patch does not address this issue.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
CPU waiting a lot), it makes sense to parallelize the tests.
However, care has to be taken that the different jobs use different
trash directories.
This commit does so, by creating the trash directories with a suffix
that is unique with regard to the test, as it is the test's base name.
Further, the trash directory is removed in the test itself if
everything went fine, so that the trash directories do not
pile up only to be removed at the very end.
If a test failed, the trash directory is not removed. Chances are
that the exact error message is lost in the clutter, but you can still
see what test failed from the name of the trash directory, and repeat
the test (without -j).
If all was good, you will see the aggregated results.
Suggestions to simplify this commit came from Junio and René.
There still is an issue with tests that want to run a server process and
listen to a fixed port (http and svn) --- they cannot run in parallel but
this patch does not address this issue.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/Makefile | patch | blob | history | |
t/test-lib.sh | patch | blob | history |
diff --git a/t/Makefile b/t/Makefile
index aa952e1c5c2793d4e801987a6f09dc91dfd1292a..ed49c20b16b520da1b460960dbadd5d31c4927ba 100644 (file)
--- a/t/Makefile
+++ b/t/Makefile
$(MAKE) $(TSVN) GIT_SVN_NO_OPTIMIZE_COMMITS=0 LC_ALL=en_US.UTF-8
.PHONY: pre-clean $(T) aggregate-results clean
-.NOTPARALLEL:
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 11c027571b44c429b4f6fdca88bff9c3360c7545..7f60b614eafb3da9f481e1c7df38f9d8fbfeb076 100644 (file)
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
# we will leave things as they are.
say_color pass "passed all $msg"
+
+ test -d "$remove_trash" &&
+ cd "$(dirname "$remove_trash")" &&
+ rm -rf "$(basename "$remove_trash")"
+
exit 0 ;;
*)
. ../GIT-BUILD-OPTIONS
# Test repository
-test="trash directory"
+test="trash directory.$(basename "$0" .sh)"
+remove_trash="$TEST_DIRECTORY/$test"
rm -fr "$test" || {
trap - exit
echo >&5 "FATAL: Cannot prepare test area"