Skip to content

Commit 8ef1abe

Browse files
avargitster
authored andcommitted
test-lib: Don't write test-results when HARNESS_ACTIVE
TAP harnesses don't need to read test-results/*, since they keep track of the number of passing/failing tests internally. Skip the generation of these files when HARNESS_ACTIVE is set. It's now possible to run the Git test suite without writing anything to the t/ directory at all if you use a TAP harness and the --root switch: cd t sudo mount -t tmpfs none /tmp/memory -o size=300m prove -j9 ./t[0-9]*.sh :: --root=/tmp/memory The I/O that the ~500 test-results/* files contributed was very minimal, but I thought this was worth mentioning. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 3d04589 commit 8ef1abe

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

t/test-lib.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -633,16 +633,19 @@ test_create_repo () {
633633

634634
test_done () {
635635
GIT_EXIT_OK=t
636-
test_results_dir="$TEST_DIRECTORY/test-results"
637-
mkdir -p "$test_results_dir"
638-
test_results_path="$test_results_dir/${0%.sh}-$$.counts"
639-
640-
echo "total $test_count" >> $test_results_path
641-
echo "success $test_success" >> $test_results_path
642-
echo "fixed $test_fixed" >> $test_results_path
643-
echo "broken $test_broken" >> $test_results_path
644-
echo "failed $test_failure" >> $test_results_path
645-
echo "" >> $test_results_path
636+
637+
if test -z "$HARNESS_ACTIVE"; then
638+
test_results_dir="$TEST_DIRECTORY/test-results"
639+
mkdir -p "$test_results_dir"
640+
test_results_path="$test_results_dir/${0%.sh}-$$.counts"
641+
642+
echo "total $test_count" >> $test_results_path
643+
echo "success $test_success" >> $test_results_path
644+
echo "fixed $test_fixed" >> $test_results_path
645+
echo "broken $test_broken" >> $test_results_path
646+
echo "failed $test_failure" >> $test_results_path
647+
echo "" >> $test_results_path
648+
fi
646649

647650
if test "$test_fixed" != 0
648651
then

0 commit comments

Comments
 (0)