2 EDG_CFLAGS="${ADDCFLAGS} -O3"
3 GCC_CFLAGS="-O3 -g -fomit-frame-pointer"
9 OUTPUTDIR="stats-`date +%d.%m.%y`"
15 XMLRES=$OUTPUTDIR/result.xml
16 cat > $XMLRES << __END__
20 <EDG_CFLAGS>${EDG_CFLAGS}</EDG_CFLAGS>
21 <GCC_CFLAGS>${GCC_CFLAGS}</GCC_CFLAGS>
25 # so endless apps stop at some point...
30 DIRS=". gcc-testsuite gcc-testsuite/ieee"
31 test -n "$1" && DIRS="$1"
35 echo "<section name=\"$curdir/\">" >> $XMLRES
36 for file in $curdir/$CFILES; do
41 FIRM_RUN_RES="omitted"
44 name="`basename $file .c`"
45 res="$OUTPUTDIR/buildresult_$name.txt"
47 echo "Results for $name" > $res
48 echo "*** EDG/FIRM Compile" >> $res
49 CMD="ulimit -t${TIMEOUT_COMPILE} ; ${EDG_BIN} ${EDG_CFLAGS} $file"
51 /bin/bash -c "ulimit -t${TIMEOUT_COMPILE} ; ${EDG_BIN} ${EDG_CFLAGS} $file" >> $res 2>&1 || COMPILE_RES="failed"
53 if [ ${COMPILE_RES} == "ok" ]; then
55 CMD="mv $curdir/$name.s build_firm/$name.s"
58 echo "*** Linking" >> $res
59 CMD="gcc build_firm/$name.s ${LINKFLAGS} -o build_firm/$name.exe"
61 $CMD >> $res 2>&1 || LINK_RES="failed"
64 echo "*** GCC Compile" >> $res
65 CMD="gcc ${GCC_CFLAGS} $file ${LINKFLAGS} -o build_gcc/$name.exe"
67 $CMD >> $res 2>&1 || GCC_RES="failed"
69 if [ ${GCC_RES} = "ok" ]; then
72 echo "*** Run GCC" >> $res
73 CMD="ulimit -t${TIMEOUT_RUN} ; build_gcc/$name.exe > $OUTPUTDIR/result_gcc_$name.txt 2>&1"
75 /bin/bash -c "ulimit -t${TIMEOUT_RUN} ; build_gcc/$name.exe" > $OUTPUTDIR/result_gcc_$name.txt 2>&1 || GCC_RUN_RES="failed"
78 if [ ${LINK_RES} = "ok" ]; then
81 echo "*** Run Firm" >> $res
82 CMD="ulimit -t${TIMEOUT_RUN} ; build_firm/$name.exe > $OUTPUTDIR/result_gcc_$name.txt 2>&1"
84 /bin/bash -c "ulimit -t${TIMEOUT_RUN} ; build_firm/$name.exe" > $OUTPUTDIR/result_firm_$name.txt 2>&1 || FIRM_RUN_RES="failed"
87 if [ ${GCC_RUN_RES} = "ok" -a ${FIRM_RUN_RES} = "ok" ]; then
90 echo "*** Compare Results" >> $res
91 CMD="diff -u $OUTPUTDIR/result_gcc_$name.txt $OUTPUTDIR/result_firm_$name.txt"
92 $CMD > $OUTPUTDIR/result_diff_$name.txt 2>&1 || DIFF_RES="failed"
95 cat >> $XMLRES << __END__
97 <compile>$COMPILE_RES</compile>
98 <link>$LINK_RES</link>
99 <gcc_compile>$GCC_RES</gcc_compile>
100 <gcc_run>$GCC_RUN_RES</gcc_run>
101 <firm_run>$FIRM_RUN_RES</firm_run>
102 <diff>$DIFF_RES</diff>
106 echo "</section>" >> $XMLRES
109 echo "</results>" >> $XMLRES
111 xsltproc --output $OUTPUTDIR/index.html makehtml.xslt $XMLRES
113 # maybe execute custom actions after result has been generated
114 [ -e after_compile.sh ] && ./after_compile.sh "$OUTPUTDIR"