From: Junio C Hamano Date: Thu, 01 Sep 2011 16:14:26 GMT Subject: Re: [PATCH] test-lib: save test counts across invocations Message-ID: <7v62lcxmsd.fsf@alter.siamese.dyndns.org> In-Reply-To: <8fe5381a6b69079b8c20452fd4d99a128764dd52.1314882443.git.trast@student.ethz.ch> Thomas Rast writes: > Save the number of tests run ($test_count) in a file under > test-counts/. Then when sourcing test-lib.sh the next time, compare > the timestamps. ... which is this logic ... > +test_count_file="$TEST_DIRECTORY"/test-counts/$(basename "$0" .sh) > +test_count_saved=$( > + if [ -n "$test_disable_saved_count" ]; then > + : > + # the saved count is only valid if the file is newer than the test > + elif [ -f "$test_count_file" -a "$test_count_file" -nt "$0" ]; then > + cat "$test_count_file" 2>/dev/null > + fi > + # otherwise we leave the variable empty > +) I think the patch is cute, but I however do not think this is sufficient to catch prerequisite changes, unfortunately. I'd rather leave the total unknown than giving incorrect numbers.