File: compile-test.sh

package info (click to toggle)
libsmbios 2.0.3.dfsg-1.1
  • links: PTS
  • area: main
  • in suites: squeeze, wheezy
  • size: 3,768 kB
  • ctags: 2,016
  • sloc: cpp: 14,292; sh: 9,408; xml: 3,820; makefile: 454; ansic: 402; python: 157
file content (26 lines) | stat: -rwxr-xr-x 723 bytes parent folder | download | duplicates (6)
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
#!/bin/sh

#
# the purpose of this program is to test that each header (include/*.h) will
# properly compile stand-alone.
#
# a .cpp file is created for each header, and include for that specific header
# is added to the .cpp file. The #include line is the only line in the header.
# This is then compiled. There should be no errors or warnings.
#

outDir=cctest-$$-$RANDOM/
mkdir $outDir
RETCODE=0

for i in include/smbios/*.h ; 
do 
    echo "Test standalone compilation of $i"
    echo "#include \"smbios/$(basename $i)\"" > $outDir/$(basename $i .h).cpp
    gcc -Wall -c -Iinclude -o $outDir/$(basename $i .h).o $outDir/$(basename $i .h).cpp
    if [ $? -ne 0 ]; then RETCODE=$?; fi
done

rm -rf $outDir

exit $RETCODE