## When writing the test summary to the console, we want to color a line
## reporting the count of some result *only* if at least one test
## experienced such a result. This function is handy in this regard.
- result_count () \
+ display_result_count () \
{ \
if test x"$$1" = x"--maybe-color"; then \
maybe_colorize=yes; \
elif test x"$$1" = x"--no-color"; then \
maybe_colorize=no; \
else \
- echo "$@: invalid 'result_count' usage" >&2; exit 4; \
+ echo "$@: invalid 'display_result_count' usage" >&2; \
+ exit 4; \
fi; \
shift; \
desc=$$1 count=$$2; \
## and a possibly-colorized one for console output.
create_testsuite_report () \
{ \
- result_count $$1 "TOTAL:" $$all "$$brg"; \
- result_count $$1 "PASS: " $$pass "$$grn"; \
- result_count $$1 "SKIP: " $$skip "$$blu"; \
- result_count $$1 "XFAIL:" $$xfail "$$lgn"; \
- result_count $$1 "FAIL: " $$fail "$$red"; \
- result_count $$1 "XPASS:" $$xpass "$$red"; \
- result_count $$1 "ERROR:" $$error "$$mgn"; \
+ opts=$$*; \
+ display_result_count $$opts "TOTAL:" $$all "$$brg"; \
+ display_result_count $$opts "PASS: " $$pass "$$grn"; \
+ display_result_count $$opts "SKIP: " $$skip "$$blu"; \
+ display_result_count $$opts "XFAIL:" $$xfail "$$lgn"; \
+ display_result_count $$opts "FAIL: " $$fail "$$red"; \
+ display_result_count $$opts "XPASS:" $$xpass "$$red"; \
+ display_result_count $$opts "ERROR:" $$error "$$mgn"; \
}; \
## Write "global" testsuite log.
if { \