diff options
Diffstat (limited to 'libacc/tests/testlocal')
-rwxr-xr-x | libacc/tests/testlocal | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/libacc/tests/testlocal b/libacc/tests/testlocal index ccabf7d..1a0b4c5 100755 --- a/libacc/tests/testlocal +++ b/libacc/tests/testlocal @@ -1,17 +1,23 @@ -#!/bin/sh -rm -f test-acc -cd .. -g++ -I../include acc.cpp disassem.cpp tests/main.cpp -g -ldl -o tests/test-acc -cd tests -if [ -x "test-acc" ]; then - ./test-acc -S data/returnval-ansi.c +#!/bin/bash - if [ "$(uname)" = "Linux" ]; then - if [ "$(uname -m)" = "i686" ]; then - echo "Linux i686. Testing otcc-ansi.c" - ./test-acc data/otcc-ansi.c data/returnval.c - echo "Linux i686. Testing otcc-ansi.c data/otcc.c" - ./test-acc data/otcc-ansi.c data/otcc.c data/returnval.c - fi - fi +SCRIPT_DIR=`dirname $BASH_SOURCE` +DATA=$SCRIPT_DIR/data +ACC=`which acc` + +echo "Compiling returnval-ansi.c" +$ACC -S $DATA/returnval-ansi.c + +echo "Compiling whole compiler." +$ACC -S "$DATA/otcc-ansi.c" + +if file $ACC | grep -q "ELF 32-bit LSB executable, Intel 80386"; then + echo "Linux 32bit Intel." + echo "TESTING returnval-ansi.c:" + $ACC -R $DATA/returnval-ansi.c + echo TESTING otcc-ansi.c returnval-ansi.c + $ACC -R "$DATA/otcc-ansi.c" "$DATA/returnval.c" + echo TESTING otcc-ansi.c otcc.c returnval-ansi.c + $ACC -R $DATA/otcc-ansi.c $DATA/otcc.c $DATA/returnval.c fi + +echo "Done with tests." |