summaryrefslogtreecommitdiff
path: root/t/test-lib.sh
diff options
context:
space:
mode:
authorFabian Stelzer <fs@gigacodes.de>2021-11-20 15:03:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-11-21 07:24:11 (GMT)
commit49da4040701f6d3dd480c6d007109c9a2fc2cb7a (patch)
treea95d78eabe4dfee6e5bce46fd180f762535a06a3 /t/test-lib.sh
parentcd3e606211bb1cf8bc57f7d76bab98cc17a150bc (diff)
downloadgit-49da4040701f6d3dd480c6d007109c9a2fc2cb7a.zip
git-49da4040701f6d3dd480c6d007109c9a2fc2cb7a.tar.gz
git-49da4040701f6d3dd480c6d007109c9a2fc2cb7a.tar.bz2
test-lib: show missing prereq summary
When running the full test suite many tests can be skipped because of missing prerequisites. It not easy right now to get an overview of which ones are missing. When switching to a new machine or environment some libraries and tools might be missing or maybe a dependency broke completely. In this case the tests would indicate nothing since all dependant tests are simply skipped. This could hide broken behaviour or missing features in the build. Therefore this patch summarizes the missing prereqs at the end of the test run making it easier to spot such cases. - Add failed prereqs to the test results. - Aggregate and then show them with the totals. Signed-off-by: Fabian Stelzer <fs@gigacodes.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib.sh')
-rw-r--r--t/test-lib.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 2679a75..f61da56 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -669,6 +669,8 @@ test_fixed=0
test_broken=0
test_success=0
+test_missing_prereq=
+
test_external_has_tap=0
die () {
@@ -1069,6 +1071,14 @@ test_skip () {
of_prereq=" of $test_prereq"
fi
skipped_reason="missing $missing_prereq${of_prereq}"
+
+ # Keep a list of all the missing prereq for result aggregation
+ if test -z "$missing_prereq"
+ then
+ test_missing_prereq=$missing_prereq
+ else
+ test_missing_prereq="$test_missing_prereq,$missing_prereq"
+ fi
fi
case "$to_skip" in
@@ -1175,6 +1185,7 @@ test_done () {
fixed $test_fixed
broken $test_broken
failed $test_failure
+ missing_prereq $test_missing_prereq
EOF
fi