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

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

Split check-build into check-doygen, check-source and check-win32.

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