Thomas Rast [off-list ref] 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.