From 2559f2d2414cdff67114f70f32162491f9a3dd1c Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Mon, 8 Feb 2010 00:40:21 +0000 Subject: [PATCH] Nicer make check output for our custom tests. --- test/check-doxygen | 10 +++++++--- test/check-source | 20 +++++++++++++------- test/check-win32 | 11 +++++++---- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/test/check-doxygen b/test/check-doxygen index 4f782ae..2c2a080 100755 --- a/test/check-doxygen +++ b/test/check-doxygen @@ -3,12 +3,16 @@ # # Check for Doxygen warnings # -if warnings="$(grep -c Warning: ../doc/doxygen.log 2>/dev/null)"; then - echo "error: $warnings warnings in Doxygen generation:" +nfiles="$(grep -c "Parsing file" < ../doc/doxygen.log)" +if nfails="$(grep -c Warning: ../doc/doxygen.log 2>/dev/null)"; then grep Warning: ../doc/doxygen.log | sed 's/\(.\{75\}\)...*/\1 .../' +fi + +echo "$nfiles files, $nfails visible errors in documentation" + +if test "$nfails" != "0"; then exit 1 fi -echo "0 visible errors in documentation" exit 0 diff --git a/test/check-source b/test/check-source index e222bd9..70657ef 100755 --- a/test/check-source +++ b/test/check-source @@ -3,30 +3,36 @@ # # Check that we have no tabs or trailing spaces in the source code # -failure=0 +nfails=0 +nfiles=0 +nlines=0 for dir in caca kernel src cxx examples ruby tools; do pushd ../$dir >/dev/null for x in $(make -s echo-sources); do case "$x" in - *.c|*.cpp|*.h|*.m) ;; - *) continue ;; + *.c|*.cpp|*.h|*.m) + nfiles=$(($nfiles + 1)); + nlines=$(($nlines + `wc -l < "$x"`)) ;; + *) + continue ;; esac if grep '[[:space:]]$' "$x" >/dev/null 2>&1; then echo "error: $dir/$x contains trailing spaces" - failure=1 + nfails=$(($nfails + 1)) fi if grep ' ' "$x" >/dev/null 2>&1; then echo "error: $dir/$x contains tabs" - failure=1 + nfails=$(($nfails + 1)) fi done popd >/dev/null done -if test "$failure" != "0"; then +echo "$nfiles files, $nlines lines, $nfails errors in source code" + +if test "$nfails" != "0"; then exit 1 fi -echo "0 errors in source code" exit 0 diff --git a/test/check-win32 b/test/check-win32 index 602bdf2..27c041b 100755 --- a/test/check-win32 +++ b/test/check-win32 @@ -9,19 +9,22 @@ ret=0 config_h_in=$(dirname "$0")/../config.h.in win32_config_h=$(dirname "$0")/../win32/config.h -failure=0 +nfails=0 +ntokens=0 for key in $(sed -ne 's/.*#undef *\([A-Za-z0-9_]*\).*/\1/p' "$config_h_in"); do + ntokens=$(($ntokens + 1)) if ! grep '[ef] \<'"$key"'\>' "$win32_config_h" >/dev/null 2>&1; then echo "error: $key missing from win32/config.h" - failure=1 + nfails=$(($nfails + 1)) fi done -if test "$failure" != "0"; then +echo "$ntokens tokens, $nfails errors in Win32 config.h" + +if test "$nfails" != "0"; then exit 1 fi -echo "0 errors in Win32 config.h" exit 0