Commit 60ae021d by Arnaud Charlet

Change output to be more cpliant with dejagnu framework.

Create acats.sum and acats.log files under testsuite/ada/acats

From-SVN: r73005
parent cc27f5a2
...@@ -18,6 +18,18 @@ $* ...@@ -18,6 +18,18 @@ $*
# End of customization section. # End of customization section.
display_noeol () {
printf "$@"
printf "$@" >> $dir/acats.sum
printf "$@" >> $dir/acats.log
}
display () {
echo "$@"
echo "$@" >> $dir/acats.sum
echo "$@" >> $dir/acats.log
}
dir=`pwd` dir=`pwd`
if [ "$testdir" = "" ]; then if [ "$testdir" = "" ]; then
...@@ -45,21 +57,20 @@ clean_dir () { ...@@ -45,21 +57,20 @@ clean_dir () {
EXTERNAL_OBJECTS="" EXTERNAL_OBJECTS=""
# Global variable to communicate external objects to link with. # Global variable to communicate external objects to link with.
echo "" rm -f $dir/acats.sum $dir/acats.log
echo ==== CONFIGURATION ==== `date`
display " === CONFIGURATION ==="
type gcc display `type gcc`
gcc -v 2>&1 display `gcc -v 2>&1`
echo host=`host_gcc -dumpmachine` display host=`host_gcc -dumpmachine`
echo target=`gcc -dumpmachine` display target=`gcc -dumpmachine`
type gnatmake display `type gnatmake`
gnatls -v gnatls -v >> $dir/acats.log
echo acats src=$testdir display ""
echo acats obj=$dir
echo ""
echo ==== SUPPORT ==== `date` display " === SUPPORT ==="
printf "Generating support files..." display_noeol "Generating support files..."
rm -rf $dir/support rm -rf $dir/support
mkdir -p $dir/support mkdir -p $dir/support
...@@ -93,7 +104,7 @@ done ...@@ -93,7 +104,7 @@ done
host_gnatmake -q -gnatws macrosub host_gnatmake -q -gnatws macrosub
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "**** Failed to compile macrosub" display "**** Failed to compile macrosub"
exit 1 exit 1
fi fi
./macrosub > macrosub.out 2>&1 ./macrosub > macrosub.out 2>&1
...@@ -101,22 +112,22 @@ fi ...@@ -101,22 +112,22 @@ fi
host_gcc -c cd300051.c host_gcc -c cd300051.c
host_gnatmake -q -gnatws widechr host_gnatmake -q -gnatws widechr
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "**** Failed to compile widechr" display "**** Failed to compile widechr"
exit 1 exit 1
fi fi
./widechr > widechr.out 2>&1 ./widechr > widechr.out 2>&1
rm -f $dir/support/{macrosub,widechr,*.ali,*.o} rm -f $dir/support/{macrosub,widechr,*.ali,*.o}
echo " done." display " done."
# From here, all compilations will be made by the target compiler # From here, all compilations will be made by the target compiler
printf "Compiling support files..." display_noeol "Compiling support files..."
target_gcc -c *.c target_gcc -c *.c
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "**** Failed to compile C code" display "**** Failed to compile C code"
exit 1 exit 1
fi fi
...@@ -125,9 +136,9 @@ gnatchop *.adt > gnatchop.out 2>&1 ...@@ -125,9 +136,9 @@ gnatchop *.adt > gnatchop.out 2>&1
target_gnatmake -c -gnato -gnatE *.ads > /dev/null 2>&1 target_gnatmake -c -gnato -gnatE *.ads > /dev/null 2>&1
target_gnatmake -c -gnato -gnatE *.adb target_gnatmake -c -gnato -gnatE *.adb
echo " done." display " done."
echo "" display ""
echo ==== TESTS ==== `date` display " === ACATS tests ==="
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
chapters=`cd $dir/tests; echo *` chapters=`cd $dir/tests; echo *`
...@@ -139,11 +150,11 @@ glob_countn=0 ...@@ -139,11 +150,11 @@ glob_countn=0
glob_countok=0 glob_countok=0
for chapter in $chapters; do for chapter in $chapters; do
echo ==== CHAPTER $chapter ==== `date` display Running chapter $chapter ...
if [ ! -d $dir/tests/$chapter ]; then if [ ! -d $dir/tests/$chapter ]; then
echo "**** CHAPTER $chapter does not exist, skipping." display "*** CHAPTER $chapter does not exist, skipping."
echo "" display ""
continue continue
fi fi
...@@ -156,9 +167,6 @@ for chapter in $chapters; do ...@@ -156,9 +167,6 @@ for chapter in $chapters; do
counti=0 counti=0
for i in `cat $dir/tests/$chapter/${chapter}.lst`; do for i in `cat $dir/tests/$chapter/${chapter}.lst`; do
counti=`expr $counti + 1` counti=`expr $counti + 1`
echo ""
echo ""
echo ==== $i === `date` === $counti / $countn
extraflags="" extraflags=""
grep $i $testdir/overflow.lst > /dev/null 2>&1 grep $i $testdir/overflow.lst > /dev/null 2>&1
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
...@@ -176,7 +184,7 @@ for chapter in $chapters; do ...@@ -176,7 +184,7 @@ for chapter in $chapters; do
ls ${i}.adb >> ${i}.lst 2> /dev/null ls ${i}.adb >> ${i}.lst 2> /dev/null
main=`tail -1 ${i}.lst` main=`tail -1 ${i}.lst`
binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'` binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'`
echo "BUILD $main" echo "BUILD $main" >> $dir/acats.log
EXTERNAL_OBJECTS="" EXTERNAL_OBJECTS=""
case $i in case $i in
cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";; cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";;
...@@ -185,7 +193,7 @@ for chapter in $chapters; do ...@@ -185,7 +193,7 @@ for chapter in $chapters; do
cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc
esac esac
if [ "$main" = "" ]; then if [ "$main" = "" ]; then
echo "**** SCRIPT-MAIN FAILED $i" display "FAIL: $i"
failed="${failed}${i} " failed="${failed}${i} "
clean_dir clean_dir
continue continue
...@@ -193,39 +201,38 @@ for chapter in $chapters; do ...@@ -193,39 +201,38 @@ for chapter in $chapters; do
target_gnatmake $extraflags -I$dir/support $main target_gnatmake $extraflags -I$dir/support $main
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "**** SCRIPT-BUILD FAILED $i" display "FAIL: $i"
failed="${failed}${i} " failed="${failed}${i} "
clean_dir clean_dir
continue continue
fi fi
echo "RUN $binmain" echo "RUN $binmain" >> $dir/acats.log
cd $dir/run cd $dir/run
target_run $dir/tests/$chapter/$i/$binmain | tee $dir/tests/$chapter/$i/${i}.log 2>&1 target_run $dir/tests/$chapter/$i/$binmain > $dir/tests/$chapter/$i/${i}.log 2>&1
cd $dir/tests/$chapter/$i cd $dir/tests/$chapter/$i
cat ${i}.log >> $dir/acats.log
egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1 egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "**** SCRIPT-RUN FAILED $i" display "FAIL: $i"
failed="${failed}${i} " failed="${failed}${i} "
else else
display "PASS: $i"
countok=`expr $countok + 1` countok=`expr $countok + 1`
fi fi
clean_dir clean_dir
done done
echo ""
echo ==== CHAPTER $chapter results: $countok / $countn
echo ""
glob_countok=`expr $glob_countok + $countok` glob_countok=`expr $glob_countok + $countok`
glob_countn=`expr $glob_countn + $countn` glob_countn=`expr $glob_countn + $countn`
done done
echo ==== ACATS results: $glob_countok / $glob_countn display " === ACATS Summary ==="
display "# of expected passes $glob_countok"
display "# of unexpected failures `expr $glob_countn - $glob_countok`"
if [ $glob_countok -ne $glob_countn ]; then if [ $glob_countok -ne $glob_countn ]; then
echo "**** FAILURES: $failed" display "*** FAILURES: $failed"
fi fi
echo "#### ACATS done. #### `date`"
exit 0 exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment