scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

chktest.sh (451B)


      1 #!/bin/sh
      2 
      3 file=${1?' empty input file'}
      4 trap "rm -f a.out; exit" 0 1 2 3 15
      5 ulimit -c 0
      6 rm -f test.log
      7 
      8 SYS=`uname | tr A-Z a-z`
      9 FORMAT=elf
     10 ABI=sysv
     11 ARCH=amd64
     12 
     13 export SYS FORMAT ABI ARCH
     14 
     15 while read i state
     16 do
     17 	echo $i >>test.log
     18 	state=${state:-""}
     19 	rm -f a.out
     20 
     21 	((SCCPREFIX=$SCCPREFIX $CC -Isysinclude $CFLAGS "$i" && ./a.out) >>test.log 2>&1 &&
     22 		printf '[PASS]' || printf '[FAIL]'
     23 	printf '\t%s\t%s\n' $i $state) | tee -a test.log
     24 done < $file