source: zzuf/trunk/test/check-build @ 4310

Last change on this file since 4310 was 4310, checked in by sam, 4 years ago

Minor testsuite behaviour updates.

  • Property svn:executable set to *
File size: 1.5 KB
Line 
1#!/bin/sh
2#
3#  check-build - check build system and source code for inconsistencies
4#  Copyright (c) 2009-2010 Sam Hocevar <sam@hocevar.net>
5#                All Rights Reserved
6#
7#  This program is free software. It comes without any warranty, to
8#  the extent permitted by applicable law. You can redistribute it
9#  and/or modify it under the terms of the Do What The Fuck You Want
10#  To Public License, Version 2, as published by Sam Hocevar. See
11#  http://sam.zoy.org/wtfpl/COPYING for more details.
12#
13
14ret=0
15
16#
17# Check that the Win32 config.h is in sync with config.h.in
18#
19
20config_h_in=$(dirname "$0")/../config.h.in
21msvc_config_h=$(dirname "$0")/../msvc/config.h
22
23failure=0
24for key in $(sed -ne 's/.*#undef *\([A-Za-z0-9_]*\).*/\1/p' "$config_h_in");
25do
26  if ! grep "[ef] $key[ (]" "$msvc_config_h" >/dev/null 2>&1; then
27    echo "error: $key missing from msvc/config.h"
28    failure=1
29  fi
30done
31if test "$failure" != "0"; then
32  ret=1
33else
34  echo "0 errors in Win32 config.h"
35fi
36
37#
38# Check that we have no tabs or trailing spaces in the source code
39#
40failure=0
41for dir in src test; do
42  (cd $(dirname "$0")/../$dir
43  for x in $(make -s echo-sources); do
44    if grep '[[:space:]]$' "$x" >/dev/null 2>&1; then
45      echo "error: $dir/$x contains trailing spaces"
46      failure=1
47    fi
48    if grep '   ' "$x" >/dev/null 2>&1; then
49      echo "error: $dir/$x contains tabs"
50      failure=1
51    fi
52  done)
53done
54if test "$failure" != "0"; then
55  ret=1
56else
57  echo "0 errors in source code"
58fi
59
60if test "$ret" != "0"; then
61  exit 1
62fi
63
64exit 0
65
Note: See TracBrowser for help on using the repository browser.