Verify compiled programs (kaem and Slow_Lisp) of test25 and test26 runs

This commit is contained in:
deesix 2019-04-21 19:22:41 +02:00
parent e55dc78597
commit 00df8e2158
6 changed files with 49 additions and 0 deletions

View File

@ -20,6 +20,8 @@ Added port to Knight-Native
Ported 4/24 working tests for AMD64
** Changed
Added basic verification of the compiled program (kaem) to test25
Added basic verification of the compiled program (Slow_Lisp) to test26
** Fixed
Corrected Global char* to behave correctly when given a static string

View File

@ -53,4 +53,15 @@ hex2 -f test/common_armv7l/ELF-armv7l-debug.hex2 \
-o test/results/test25-armv7l-binary \
--exec_enable || exit 4
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test25-armv7l-binary --version 2>&1 )
[ 0 = $? ] || exit 5
[ "$out" = "kaem version 0.1" ] || exit 6
# Verify that the resulting file works
out=$(./test/results/test25-armv7l-binary --file test/test25/kaem.run)
[ "$out" = "hello world" ] || exit 7
fi
exit 0

View File

@ -53,4 +53,15 @@ hex2 -f test/common_x86/ELF-i386-debug.hex2 \
-o test/results/test25-x86-binary \
--exec_enable || exit 4
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test25-x86-binary --version 2>&1 )
[ 0 = $? ] || exit 5
[ "$out" = "kaem version 0.1" ] || exit 6
# Verify that the resulting file works
out=$(./test/results/test25-x86-binary --file test/test25/kaem.run)
[ "$out" = "hello world" ] || exit 7
fi
exit 0

1
test/test25/kaem.run Normal file
View File

@ -0,0 +1 @@
echo "hello world"

View File

@ -56,4 +56,16 @@ hex2 -f test/common_armv7l/ELF-armv7l-debug.hex2 \
-o test/results/test26-armv7l-binary \
--exec_enable || exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test26-armv7l-binary --version 2>&1 )
[ 0 = $? ] || exit 5
[ "$out" = "Slow_Lisp 0.1" ] || exit 6
# Verify that the resulting file works
out=$(echo "(* 2 3 7)" | ./test/results/test26-armv7l-binary)
[ "$out" = "42" ] || exit 7
fi
exit 0

View File

@ -56,4 +56,16 @@ hex2 -f test/common_x86/ELF-i386-debug.hex2 \
-o test/results/test26-x86-binary \
--exec_enable || exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
# Verify that the compiled program returns the correct result
out=$(./test/results/test26-x86-binary --version 2>&1 )
[ 0 = $? ] || exit 5
[ "$out" = "Slow_Lisp 0.1" ] || exit 6
# Verify that the resulting file works
out=$(echo "(* 2 3 7)" | ./test/results/test26-x86-binary)
[ "$out" = "42" ] || exit 7
fi
exit 0