run_all.sh
来自「xml大全 可读写调用率很高 xml大全 可读写调用率很高」· Shell 代码 · 共 270 行
SH
270 行
#!/bin/sh# Run ACATS with the GNU Ada compiler# The following functions are to be customized if you run in cross# environment or want to change compilation flags. Note that for# tests requiring checks not turned on by default, this script# automatically adds the needed flags to pass (ie: -gnato or -gnatE).# gccflags="-O3 -fomit-frame-pointer -funroll-all-loops -finline-functions"# gnatflags="-gnatN"gccflags=""gnatflags="-gnatws"target_run () {$*}# 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}log () { echo "$@" >> $dir/acats.sum echo "$@" >> $dir/acats.log}dir=`${PWDCMD-pwd}`if [ "$testdir" = "" ]; then echo You must use make check or make check-ada exit 1fiif [ "$dir" = "$testdir" ]; then echo "error: srcdir must be different than objdir, exiting." exit 1fitarget_gnatchop () { gnatchop --GCC="$GCC_DRIVER" $*}target_gnatmake () { echo gnatmake --GCC=\"$GCC\" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC=\"$GCC\" gnatmake --GCC="$GCC" $gnatflags $gccflags $* -largs $EXTERNAL_OBJECTS --GCC="$GCC"}target_gcc () { $GCC $gccflags $*}clean_dir () { rm -f "$binmain" *.o *.ali > /dev/null 2>&1}EXTERNAL_OBJECTS=""# Global variable to communicate external objects to link with.rm -f $dir/acats.sum $dir/acats.logdisplay " === acats configuration ==="display target gcc is $GCCdisplay `$GCC -v 2>&1`display host=`gcc -dumpmachine`display target=`$GCC -dumpmachine`display `type gnatmake`gnatls -v >> $dir/acats.logdisplay ""display " === acats support ==="display_noeol "Generating support files..."rm -rf $dir/supportmkdir -p $dir/supportcd $dir/supportcp $testdir/support/*.ada $testdir/support/*.a $testdir/support/*.tst $dir/supportsed -e "s,ACATS4GNATDIR,$dir,g" \ < $testdir/support/impdef.a > $dir/support/impdef.ased -e "s,ACATS4GNATDIR,$dir,g" \ < $testdir/support/macro.dfs > $dir/support/MACRO.DFSsed -e "s,ACATS4GNATDIR,$dir,g" \ < $testdir/support/tsttests.dat > $dir/support/TSTTESTS.DATcp $testdir/tests/cd/*.c $dir/supportcp $testdir/tests/cxb/*.c $dir/supportrm -rf $dir/runmv $dir/tests $dir/tests.$$ 2> /dev/nullrm -rf $dir/tests.$$ &mkdir -p $dir/runcp -pr $testdir/tests $dir/for i in $dir/support/*.ada $dir/support/*.a; do host_gnatchop $i >> $dir/acats.log 2>&1done# These tools are used to preprocess some ACATS sources# they need to be compiled native on the host.host_gnatmake -q -gnatws macrosub.adbif [ $? -ne 0 ]; then display "**** Failed to compile macrosub" exit 1fi./macrosub > macrosub.out 2>&1gcc -c cd300051.chost_gnatmake -q -gnatws widechr.adbif [ $? -ne 0 ]; then display "**** Failed to compile widechr" exit 1fi./widechr > widechr.out 2>&1rm -f $dir/support/macrosubrm -f $dir/support/widechrrm -f $dir/support/*.alirm -f $dir/support/*.odisplay " done."# From here, all compilations will be made by the target compilerdisplay_noeol "Compiling support files..."target_gcc -c *.cif [ $? -ne 0 ]; then display "**** Failed to compile C code" exit 1fitarget_gnatchop *.adt >> $dir/acats.log 2>&1target_gnatmake -c -gnato -gnatE *.ads >> $dir/acats.log 2>&1target_gnatmake -c -gnato -gnatE *.adb >> $dir/acats.log 2>&1display " done."display ""display " === acats tests ==="if [ $# -eq 0 ]; then chapters=`cd $dir/tests; echo [a-z]*`else chapters=$*figlob_countn=0glob_countok=0glob_countu=0for chapter in $chapters; do display Running chapter $chapter ... if [ ! -d $dir/tests/$chapter ]; then display "*** CHAPTER $chapter does not exist, skipping." display "" continue fi cd $dir/tests/$chapter ls *.a *.ada *.adt *.am *.dep 2> /dev/null | sed -e 's/\(.*\)\..*/\1/g' | \ cut -c1-7 | sort | uniq | comm -23 - $testdir/norun.lst \ > $dir/tests/$chapter/${chapter}.lst countn=`wc -l < $dir/tests/$chapter/${chapter}.lst` glob_countn=`expr $glob_countn + $countn` counti=0 for i in `cat $dir/tests/$chapter/${chapter}.lst`; do counti=`expr $counti + 1` extraflags="" grep $i $testdir/overflow.lst > /dev/null 2>&1 if [ $? -eq 0 ]; then extraflags="$extraflags -gnato" fi grep $i $testdir/elabd.lst > /dev/null 2>&1 if [ $? -eq 0 ]; then extraflags="$extraflags -gnatE" fi test=$dir/tests/$chapter/$i mkdir $test && cd $test >> $dir/acats.log 2>&1 if [ $? -ne 0 ]; then display "FAIL: $i" failed="${failed}${i} " clean_dir continue fi target_gnatchop -c -w `ls ${test}*.a ${test}*.ada ${test}*.adt ${test}*.am ${test}*.dep 2> /dev/null` >> $dir/acats.log 2>&1 ls ${i}?.adb > ${i}.lst 2> /dev/null ls ${i}*m.adb >> ${i}.lst 2> /dev/null ls ${i}.adb >> ${i}.lst 2> /dev/null main=`tail -1 ${i}.lst` binmain=`echo $main | sed -e 's/\(.*\)\..*/\1/g'` echo "BUILD $main" >> $dir/acats.log EXTERNAL_OBJECTS="" case $i in cxb30*) EXTERNAL_OBJECTS="$dir/support/cxb30040.o $dir/support/cxb30060.o $dir/support/cxb30130.o $dir/support/cxb30131.o";; ca1020e) rm -f ca1020e_func1.adb ca1020e_func2.adb ca1020e_proc1.adb ca1020e_proc2.adb > /dev/null 2>&1;; ca14028) rm -f ca14028_func2.ads ca14028_func3.ads ca14028_proc1.ads ca14028_proc3.ads > /dev/null 2>&1;; cxh1001) extraflags="-a -f"; echo "pragma Normalize_Scalars;" > gnat.adc esac if [ "$main" = "" ]; then display "FAIL: $i" failed="${failed}${i} " clean_dir continue fi target_gnatmake $extraflags -I$dir/support $main >> $dir/acats.log 2>&1 if [ $? -ne 0 ]; then display "FAIL: $i" failed="${failed}${i} " clean_dir continue fi echo "RUN $binmain" >> $dir/acats.log cd $dir/run target_run $dir/tests/$chapter/$i/$binmain > $dir/tests/$chapter/$i/${i}.log 2>&1 cd $dir/tests/$chapter/$i cat ${i}.log >> $dir/acats.log egrep -e '(==== |\+\+\+\+ |\!\!\!\! )' ${i}.log > /dev/null 2>&1 if [ $? -ne 0 ]; then grep 'Tasking not implemented' ${i}.log > /dev/null 2>&1 if [ $? -ne 0 ]; then display "FAIL: $i" failed="${failed}${i} " else log "UNSUPPORTED: $i" glob_countn=`expr $glob_countn - 1` glob_countu=`expr $glob_countu + 1` fi else log "PASS: $i" glob_countok=`expr $glob_countok + 1` fi clean_dir donedonedisplay " === acats Summary ==="display "# of expected passes $glob_countok"display "# of unexpected failures `expr $glob_countn - $glob_countok`"if [ $glob_countu -ne 0 ]; then display "# of unsupported tests $glob_countu"fiif [ $glob_countok -ne $glob_countn ]; then display "*** FAILURES: $failed"fiexit 0
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?