source: libcaca/trunk/test/check-source @ 4351

Last change on this file since 4351 was 4351, checked in by Sam Hocevar, 10 years ago

Get rid of pushd/popd in the testsuite.

  • Property svn:executable set to *
File size: 800 bytes
Line 
1#!/bin/sh
2
3#
4# Check that we have no tabs or trailing spaces in the source code
5#
6nfails=0
7nfiles=0
8nlines=0
9for dir in caca kernel src cxx examples ruby tools; do
10  for x in $(make -s echo-sources -C ../$dir); do
11    case "$x" in
12      *.c|*.cpp|*.h|*.m)
13        nfiles=$(($nfiles + 1));
14        nlines=$(($nlines + `grep -c . "../$dir/$x"`)) ;;
15      *)
16        continue ;;
17    esac
18    if grep '[[:space:]]$' "../$dir/$x" >/dev/null 2>&1; then
19      echo "error: $dir/$x contains trailing spaces"
20      nfails=$(($nfails + 1))
21    fi
22    if grep '   ' "../$dir/$x" >/dev/null 2>&1; then
23      echo "error: $dir/$x contains tabs"
24      nfails=$(($nfails + 1))
25    fi
26  done
27done
28
29echo "$nfiles files, $nlines lines, $nfails errors in source code"
30
31if test "$nfails" != "0"; then
32  exit 1
33fi
34
35exit 0
36
Note: See TracBrowser for help on using the repository browser.