File: header_test

package info (click to toggle)
schroedinger 1.0.11-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 8,480 kB
  • sloc: ansic: 97,380; sh: 11,238; xml: 6,509; makefile: 386
file content (38 lines) | stat: -rwxr-xr-x 584 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh

verbose=true
if $verbose
then
  REDIRECT=
else
  REDIRECT=">/dev/null 2>/dev/null"
fi

CC=gcc
pkg=schroedinger-1.0
includedir=$(pkg-config --variable=includedir ${pkg})

CFLAGS="-Wall -Werror $(pkg-config --cflags ${pkg}) -DSCHRO_ENABLE_UNSTABLE_API"

headers="$(cd ${includedir} && find . -type f -name '*.h')"

fail=false
for each in $headers
do
  echo -n "$each... "
  echo "#include <$each>" >test.c
  if ${CC} ${CFLAGS} test.c -c -o test.o ${REDIRECT}
  then
    echo OK
  else
    echo failed
    fail=true
  fi
done

if [ "$fail" = "true" ]
then
  exit 1
fi
exit 0