git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2] test-lib: Don't write test-results when HARNESS_ACTIVE

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Aug 11, 2010, 19:37 UTC
Message-ID
<1281555451-6847-1-git-send-email-avarab@gmail.com>
In-Reply-To
<1278632080-31949-1-git-send-email-avarab@gmail.com>

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>
---

This one fell through the cracks, and conflicted with Thomas's later "Only run aggregate-results over actual counts" patch.

Please apply it, it keeps conflicting with local changes I have to the test-lib.sh

 t/test-lib.sh |   23 +++++++++++++----------
 1 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 4e73fff..956f1a5 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -646,16 +646,19 @@ test_create_repo () {
 
 test_done () {
 	GIT_EXIT_OK=t
-	test_results_dir="$TEST_DIRECTORY/test-results"
-	mkdir -p "$test_results_dir"
-	test_results_path="$test_results_dir/${0%.sh}-$$.counts"
-
-	echo "total $test_count" >> $test_results_path
-	echo "success $test_success" >> $test_results_path
-	echo "fixed $test_fixed" >> $test_results_path
-	echo "broken $test_broken" >> $test_results_path
-	echo "failed $test_failure" >> $test_results_path
-	echo "" >> $test_results_path
+
+	if test -z "$HARNESS_ACTIVE"; then
+		test_results_dir="$TEST_DIRECTORY/test-results"
+		mkdir -p "$test_results_dir"
+		test_results_path="$test_results_dir/${0%.sh}-$$.counts"
+
+		echo "total $test_count" >> $test_results_path
+		echo "success $test_success" >> $test_results_path
+		echo "fixed $test_fixed" >> $test_results_path
+		echo "broken $test_broken" >> $test_results_path
+		echo "failed $test_failure" >> $test_results_path
+		echo "" >> $test_results_path
+	fi
 
 	if test "$test_fixed" != 0
 	then
-- 
1.7.2.1.295.gdf931
Previous: Ævar Arnfjörð Bjarmason
Message 2 of 2 in “test-lib: Don't write test-results when HARNESS_ACTIVE”
  1. test-lib: Don't write test-results when HARNESS_ACTIVEÆvar Arnfjörð Bjarmason, Jul 8, 2010
  2. test-lib: Don't write test-results when HARNESS_ACTIVEÆvar Arnfjörð Bjarmason, Aug 11, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.