Changeset 3993


Ignore:
Timestamp:
Nov 21, 2009, 6:01:30 PM (14 years ago)
Author:
Sam Hocevar
Message:

Add a sanity check for coding style errors.

Location:
libcaca/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/Makefile.am

    r3598 r3993  
    11# $Id$
    22
    3 SUBDIRS = kernel caca src examples tests tools caca-sharp cxx python ruby doc
     3SUBDIRS = kernel caca src examples tools caca-sharp cxx python ruby doc tests
    44DIST_SUBDIRS = $(SUBDIRS) win32
    55
  • libcaca/trunk/examples/.gitignore

    r3598 r3993  
    2424text
    2525transform
     26trifiller
    2627truecolor
    2728unicode
  • libcaca/trunk/tests/check-build

    r3907 r3993  
    11#!/bin/sh
    22
    3 failure=0
     3ret=0
     4
     5#
     6# Check that the Win32 config.h is in sync with config.h.in
     7#
    48
    59config_h_in=$(dirname "$0")/../config.h.in
    610win32_config_h=$(dirname "$0")/../win32/config.h
    711
     12failure=0
    813for key in $(sed -ne 's/.*#undef *\([A-Za-z0-9_]*\).*/\1/p' "$config_h_in");
    914do
     
    1318  fi
    1419done
    15 
    1620if test "$failure" != "0"; then
    17   exit 1
     21  ret=1
    1822else
    1923  echo "0 errors in Win32 config.h"
    2024fi
    2125
     26#
     27# Check that we have no tabs or trailing spaces in the source code
     28#
     29failure=0
     30for dir in caca cxx examples ruby tools; do
     31  pushd ../$dir >/dev/null
     32  # Dirty hack to print the $(SOURCES) variable
     33  for x in $(make -s ID SHELL='echo @@$(SOURCES)@@' | tr -d '\n' | sed 's/.*@@\([^@]*\)@@.*/\1/');
     34  do
     35    if grep '[[:space:]]$' "$x" >/dev/null 2>&1; then
     36      echo "error: $dir/$x contains trailing spaces"
     37      failure=1
     38    fi
     39    if grep '   ' "$x" >/dev/null 2>&1; then
     40      echo "error: $dir/$x contains tabs"
     41      failure=1
     42    fi
     43  done
     44  popd >/dev/null
     45done
     46if test "$failure" != "0"; then
     47  ret=1
     48else
     49  echo "0 errors in source code"
     50fi
     51
     52if test "$ret" != "0"; then
     53  exit 1
     54fi
     55
    2256exit 0
    2357
Note: See TracChangeset for help on using the changeset viewer.