4 EDG_CFLAGS="${ADDCFLAGS} -O3 -c"
5 GCC_CFLAGS="-O3 -g -fomit-frame-pointer"
11 OUTPUTDIR="stats-`date +%d.%m.%y`"
17 XMLRES=$OUTPUTDIR/result.xml
18 cat > $XMLRES << __END__
22 <EDG_CFLAGS>${EDG_CFLAGS}</EDG_CFLAGS>
23 <GCC_CFLAGS>${GCC_CFLAGS}</GCC_CFLAGS>
27 # so endless apps stop at some point...
32 DIRS=". gcc-testsuite gcc-testsuite/ieee langshootout"
33 test -n "$1" && DIRS="$1"
37 echo "<section name=\"$curdir/\">" >> $XMLRES
38 for file in $curdir/$CFILES; do
43 FIRM_RUN_RES="omitted"
46 name="`basename $file .c`"
47 res="$OUTPUTDIR/buildresult_$name.txt"
49 echo "Results for $name" > $res
50 echo "*** EDG/FIRM Compile" >> $res
51 CMD="ulimit -t${TIMEOUT_COMPILE} ; ${EDG_BIN} ${EDG_CFLAGS} $file"
53 /bin/bash -c "ulimit -t${TIMEOUT_COMPILE} ; ${EDG_BIN} ${EDG_CFLAGS} $file" >> $res 2>&1 || COMPILE_RES="failed"
55 if [ ${COMPILE_RES} == "ok" ]; then
57 CMD="mv $curdir/$name.s build_firm/$name.s"
60 echo "*** Linking" >> $res
61 CMD="gcc build_firm/$name.s ${LINKFLAGS} -o build_firm/$name.exe"
63 $CMD >> $res 2>&1 || LINK_RES="failed"
66 echo "*** GCC Compile" >> $res
67 CMD="gcc ${GCC_CFLAGS} $file ${LINKFLAGS} -o build_gcc/$name.exe"
69 $CMD >> $res 2>&1 || GCC_RES="failed"
71 if [ ${GCC_RES} = "ok" ]; then
74 echo "*** Run GCC" >> $res
75 CMD="ulimit -t${TIMEOUT_RUN} ; build_gcc/$name.exe > $OUTPUTDIR/result_gcc_$name.txt 2>&1"
77 /bin/bash -c "ulimit -t${TIMEOUT_RUN} ; build_gcc/$name.exe" > $OUTPUTDIR/result_gcc_$name.txt 2>&1 || GCC_RUN_RES="failed"
80 if [ ${LINK_RES} = "ok" ]; then
83 echo "*** Run Firm" >> $res
84 CMD="ulimit -t${TIMEOUT_RUN} ; build_firm/$name.exe > $OUTPUTDIR/result_gcc_$name.txt 2>&1"
86 /bin/bash -c "ulimit -t${TIMEOUT_RUN} ; build_firm/$name.exe" > $OUTPUTDIR/result_firm_$name.txt 2>&1 || FIRM_RUN_RES="failed"
89 if [ ${GCC_RUN_RES} = "ok" -a ${FIRM_RUN_RES} = "ok" ]; then
92 echo "*** Compare Results" >> $res
93 CMD="diff -u $OUTPUTDIR/result_gcc_$name.txt $OUTPUTDIR/result_firm_$name.txt"
94 $CMD > $OUTPUTDIR/result_diff_$name.txt 2>&1 || DIFF_RES="failed"
97 cat >> $XMLRES << __END__
99 <compile>$COMPILE_RES</compile>
100 <link>$LINK_RES</link>
101 <gcc_compile>$GCC_RES</gcc_compile>
102 <gcc_run>$GCC_RUN_RES</gcc_run>
103 <firm_run>$FIRM_RUN_RES</firm_run>
104 <diff>$DIFF_RES</diff>
108 echo "</section>" >> $XMLRES
111 echo "</results>" >> $XMLRES
113 xsltproc --output $OUTPUTDIR/index.html makehtml.xslt $XMLRES
115 # maybe execute custom actions after result has been generated
116 [ -e after_compile.sh ] && ./after_compile.sh "$OUTPUTDIR"