瀏覽代碼

Add a source code sanity check.

pull/1/head
Sam Hocevar sam 15 年之前
父節點
當前提交
63311c54a5
共有 6 個檔案被更改,包括 46 行新增1 行删除
  1. +1
    -1
      Makefile.am
  2. +1
    -0
      configure.ac
  3. +2
    -0
      src/Makefile.am
  4. +6
    -0
      test/Makefile.am
  5. +34
    -0
      test/check-build
  6. +2
    -0
      tools/Makefile.am

+ 1
- 1
Makefile.am 查看文件

@@ -1,5 +1,5 @@

SUBDIRS = src tools fonts doc
SUBDIRS = src tools fonts doc test
DIST_SUBDIRS = $(SUBDIRS)

EXTRA_DIST = bootstrap


+ 1
- 0
configure.ac 查看文件

@@ -78,5 +78,6 @@ AC_OUTPUT([
tools/Makefile
fonts/Makefile
doc/Makefile
test/Makefile
])


+ 2
- 0
src/Makefile.am 查看文件

@@ -10,3 +10,5 @@ toilet_CPPFLAGS = -DFONTDIR=\"$(datadir)/figlet\"
toilet_CFLAGS = @CACA_CFLAGS@
toilet_LDADD = @CACA_LIBS@ @GETOPT_LIBS@ @ZLIB_LIBS@

echo-sources: ; echo $(SOURCES)


+ 6
- 0
test/Makefile.am 查看文件

@@ -0,0 +1,6 @@
# $Id$

EXTRA_DIST = check-build

TESTS = check-build


+ 34
- 0
test/check-build 查看文件

@@ -0,0 +1,34 @@
#!/bin/sh

ret=0

#
# Check that we have no tabs or trailing spaces in the source code
#
failure=0
for dir in src tools; do
pushd ../$dir >/dev/null
for x in $(make echo-sources); do
if grep '[[:space:]]$' "$x" >/dev/null 2>&1; then
echo "error: $dir/$x contains trailing spaces"
failure=1
fi
if grep ' ' "$x" >/dev/null 2>&1; then
echo "error: $dir/$x contains tabs"
failure=1
fi
done
popd >/dev/null
done
if test "$failure" != "0"; then
ret=1
else
echo "0 errors in source code"
fi

if test "$ret" != "0"; then
exit 1
fi

exit 0


+ 2
- 0
tools/Makefile.am 查看文件

@@ -6,3 +6,5 @@ caca2tlf_SOURCES = caca2tlf.c
caca2tlf_CFLAGS = @CACA_CFLAGS@
caca2tlf_LDADD = @CACA_LIBS@

echo-sources: ; echo $(SOURCES)


Loading…
取消
儲存