test.sh: debug help for failing test.
This commit is contained in:
parent
518f11c606
commit
aaa255de26
|
@ -0,0 +1,12 @@
|
|||
#! /bin/sh
|
||||
set -ex
|
||||
|
||||
export PREFIX=usr
|
||||
export HEX2=../mescc-tools/bin/hex2
|
||||
export M1=../mescc-tools/bin/M1
|
||||
export BLOOD_ELF=../mescc-tools/bin/blood-elf
|
||||
export MESCC=../mes/guile/mescc.scm
|
||||
export MES_PREFIX=../mes
|
||||
export TINYCC_SEED=${TINYCC_SEED-../tinycc-seed}
|
||||
|
||||
./test.sh ${1-t}
|
45
test.sh
45
test.sh
|
@ -9,29 +9,54 @@ rm -f "scaffold/tests/$t".mes-out
|
|||
MESCC=${MESCC-mescc}
|
||||
MES_PREFIX=${MES_PREFIX-$(dirname $MESCC)/../share/mes}
|
||||
TINYCC_SEED=${TINYCC_SEED-../tinycc-seed}
|
||||
OBJDUMP=${OBJDUMP-objdump}
|
||||
|
||||
mkdir -p scaffold/tests
|
||||
|
||||
if [ -x ./i686-unknown-linux-gnu-tcc ]; then
|
||||
./i686-unknown-linux-gnu-tcc -static -o "scaffold/tests/$t".i686-unknown-linux-gnu-out\
|
||||
-I $MES_PREFIX/include\
|
||||
-I $MES_PREFIX/scaffold/tests\
|
||||
$MES_PREFIX/scaffold/tests/"$t".c &> 1
|
||||
./i686-unknown-linux-gnu-tcc\
|
||||
-c\
|
||||
-o scaffold/tests/"$t".i686-unknown-linux-gnu-o\
|
||||
-I $MES_PREFIX/include\
|
||||
-I $MES_PREFIX/scaffold/tests\
|
||||
$MES_PREFIX/scaffold/tests/"$t".c &> 1
|
||||
$OBJDUMP -d scaffold/tests/"$t".i686-unknown-linux-gnu-o > 1.s
|
||||
|
||||
./i686-unknown-linux-gnu-tcc\
|
||||
-static\
|
||||
-o scaffold/tests/"$t".i686-unknown-linux-gnu-out\
|
||||
-I $MES_PREFIX/include\
|
||||
-I $MES_PREFIX/scaffold/tests\
|
||||
$MES_PREFIX/scaffold/tests/"$t".c &> 1.elf
|
||||
|
||||
set +e
|
||||
"scaffold/tests/$t.i686-unknown-linux-gnu-out"
|
||||
scaffold/tests/"$t".i686-unknown-linux-gnu-out
|
||||
r=$?
|
||||
#$OBJDUMP -d scaffold/tests/"$t".i686-unknown-linux-gnu-out > 1.x
|
||||
set -e
|
||||
else
|
||||
r=0
|
||||
fi
|
||||
|
||||
./mes-tcc -static -o "scaffold/tests/$t".mes-out\
|
||||
-I $MES_PREFIX/include\
|
||||
-I $MES_PREFIX/scaffold/tests\
|
||||
$MES_PREFIX/scaffold/tests/"$t".c &> 2
|
||||
|
||||
./mes-tcc\
|
||||
-c\
|
||||
-o scaffold/tests/"$t".mes-o\
|
||||
-I $MES_PREFIX/include\
|
||||
-I $MES_PREFIX/scaffold/tests\
|
||||
$MES_PREFIX/scaffold/tests/"$t".c &> 2
|
||||
$OBJDUMP -d scaffold/tests/"$t".mes-o > 2.s
|
||||
./mes-tcc\
|
||||
-static\
|
||||
-o scaffold/tests/"$t".mes-out\
|
||||
-I $MES_PREFIX/include\
|
||||
-I $MES_PREFIX/scaffold/tests\
|
||||
$MES_PREFIX/scaffold/tests/"$t".c &> 2.elf
|
||||
set +e
|
||||
scaffold/tests/"$t".mes-out
|
||||
m=$?
|
||||
#$OBJDUMP -d scaffold/tests/"$t".mes-out > 2.x
|
||||
|
||||
[ $m = $r ]
|
||||
|
||||
#diff -y 1.s 2.s
|
||||
#diff -y 1 2
|
||||
|
|
Loading…
Reference in New Issue