Ignore:
Timestamp:
Feb 8, 2010, 1:40:21 AM (10 years ago)
Author:
Sam Hocevar
Message:

Nicer make check output for our custom tests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/test/check-source

    r4320 r4332  
    44# Check that we have no tabs or trailing spaces in the source code
    55#
    6 failure=0
     6nfails=0
     7nfiles=0
     8nlines=0
    79for dir in caca kernel src cxx examples ruby tools; do
    810  pushd ../$dir >/dev/null
    911  for x in $(make -s echo-sources); do
    1012    case "$x" in
    11      *.c|*.cpp|*.h|*.m) ;;
    12      *) continue ;;
     13      *.c|*.cpp|*.h|*.m)
     14        nfiles=$(($nfiles + 1));
     15        nlines=$(($nlines + `wc -l < "$x"`)) ;;
     16      *)
     17        continue ;;
    1318    esac
    1419    if grep '[[:space:]]$' "$x" >/dev/null 2>&1; then
    1520      echo "error: $dir/$x contains trailing spaces"
    16       failure=1
     21      nfails=$(($nfails + 1))
    1722    fi
    1823    if grep '   ' "$x" >/dev/null 2>&1; then
    1924      echo "error: $dir/$x contains tabs"
    20       failure=1
     25      nfails=$(($nfails + 1))
    2126    fi
    2227  done
     
    2429done
    2530
    26 if test "$failure" != "0"; then
     31echo "$nfiles files, $nlines lines, $nfails errors in source code"
     32
     33if test "$nfails" != "0"; then
    2734  exit 1
    2835fi
    2936
    30 echo "0 errors in source code"
    3137exit 0
    3238
Note: See TracChangeset for help on using the changeset viewer.