Revised tests to include dwarf stubs

This commit is contained in:
Jeremiah Orians 2020-02-01 17:50:26 -05:00
parent 1f709f3ff1
commit aad1198faf
No known key found for this signature in database
GPG Key ID: 5410E91C14959E87
9 changed files with 146 additions and 86 deletions

View File

@ -16,6 +16,7 @@
* Current
** Added
Added test for chdir and getcwd family of posix primitives
** Changed

View File

@ -353,6 +353,9 @@ test25-aarch64-binary: M2-Planet | results
test26-aarch64-binary: M2-Planet | results
test/test26/hello-aarch64.sh
test27-aarch64-binary: M2-Planet | results
test/test27/hello-aarch64.sh
test99-aarch64-binary: M2-Planet | results
test/test99/hello-aarch64.sh

View File

@ -153,11 +153,11 @@ e1fca774a067de5edb7eb1165619573993d2a5e5647c05568a68f3a53a7990cd test/results/t
60206125928d77a758cd73ec8e85f8592423ce678570ebbe7876b71dc38aaeaf test/results/test26-amd64-binary
649349e01a90ce93ba72ba1b9bb81a9bd9d79b580ddff366173c98835c10b976 test/results/test26-armv7l-binary
576511f1f6699e7798bcab2f36bf8eb86825fd13748770b17f46c3a691200b01 test/results/test26-x86-binary
12de91f702b0ced71801c1662dc0a3e253158238e1d1a0b9bc54015a24fd77cc test/results/test27-aarch64-binary
1250294c2fddcdd37072fef4c753de3bd5b1a5f754d75448044211116be08bd9 test/results/test27-amd64-binary
669af3d269283cb44ae6f29ff7f0522e615380befe0a5a5e0fe731f122236f0a test/results/test27-armv7l-binary
32afdc9cb944b6f1db101050dd45947bdffac5ca92eb0407169e6466f878433d test/results/test27-aarch64-binary
e265ee574e7277f81dbecde7d0941f18704379898299c47b24e55cd6ca1b362a test/results/test27-amd64-binary
4d7a84b6f861807c629bf26bba759ce45c5f3f093b28bcd050dd93f449e2bf47 test/results/test27-armv7l-binary
d83e0aae5b335f34a528bbb6c213bbef9d993abae335e0f909183bc6debfd37b test/results/test27-knight-posix-binary
cc21839d9b89016cb9ccc059dfbe19c2490c2527975401812d950bf12f716c85 test/results/test27-x86-binary
9d0ea091b1ac5fa5a9882ce93c816f2047a6751dc6edb7fef808a545ce3261f2 test/results/test27-x86-binary
fd72ce6ebbf8263ef9fdff9ca7d789a55ba399ab222c2f5f93b138c61830376d test/results/test99-aarch64-binary
717c42e1a1a91ef5b67ce298bc92a148418a5dec6761a358a52b22a01f16c928 test/results/test99-amd64-binary
4e759b212b087824f7b0f14c5147272c9984c4a4d00074b2fd771c3d004c9aec test/results/test99-armv7l-binary

View File

@ -15,5 +15,6 @@
## You should have received a copy of the GNU General Public License
## along with M2-Planet. If not, see <http://www.gnu.org/licenses/>.
rm -f test/test27/chdir.M1
rm -f test/test27/chdir-footer.M1
rm -f test/test27/chdir.hex2
exit 0

View File

@ -18,35 +18,47 @@
set -x
# Build the test
bin/M2-Planet --architecture aarch64 \
-f test/common_aarch64/functions/chdir.c \
-f test/common_aarch64/functions/malloc.c \
-f test/common_aarch64/functions/getcwd.c \
-f test/common_aarch64/functions/exit.c \
-f test/common_aarch64/functions/file.c \
-f functions/calloc.c \
-f functions/string.c \
-f functions/match.c \
-f functions/file_print.c \
-f test/test27/chdir.c \
-f test/common_aarch64/functions/chdir.c \
-f test/common_aarch64/functions/malloc.c \
-f test/common_aarch64/functions/getcwd.c \
-f test/common_aarch64/functions/exit.c \
-f test/common_aarch64/functions/file.c \
-f functions/calloc.c \
-f functions/string.c \
-f functions/match.c \
-f functions/file_print.c \
-f test/test27/chdir.c \
--debug \
-o test/test27/chdir.M1 || exit 1
# Build debug footer
blood-elf --64 -f test/test27/chdir.M1 \
-o test/test27/chdir-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro
M1 -f test/common_aarch64/aarch64_defs.M1 \
-f test/common_aarch64/libc-core.M1 \
-f test/test27/chdir.M1 \
-f test/test27/chdir-footer.M1 \
--LittleEndian \
--architecture aarch64 \
-o test/test27/chdir.hex2 || exit 2
-o test/test27/chdir.hex2 || exit 3
# Resolve all linkages
hex2 -f test/common_aarch64/ELF-aarch64.hex2 -f test/test27/chdir.hex2 --LittleEndian --architecture aarch64 --BaseAddress 0x40000 -o test/results/test27-aarch64-binary --exec_enable || exit 3
hex2 -f test/common_aarch64/ELF-aarch64-debug.hex2 \
-f test/test27/chdir.hex2 \
--LittleEndian \
--architecture aarch64 \
--BaseAddress 0x40000 \
-o test/results/test27-aarch64-binary \
--exec_enable || exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "aarch64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test27-aarch64-binary
[ 0 = $? ] || exit 4
. ./sha256.sh
# Verify that the resulting file works
./test/results/test27-aarch64-binary
[ 0 = $? ] || exit 5
fi
exit 0

View File

@ -18,35 +18,47 @@
set -x
# Build the test
bin/M2-Planet --architecture amd64 \
-f test/common_amd64/functions/chdir.c \
-f test/common_amd64/functions/malloc.c \
-f test/common_amd64/functions/getcwd.c \
-f test/common_amd64/functions/exit.c \
-f test/common_amd64/functions/file.c \
-f functions/calloc.c \
-f functions/string.c \
-f functions/match.c \
-f functions/file_print.c \
-f test/test27/chdir.c \
-f test/common_amd64/functions/chdir.c \
-f test/common_amd64/functions/malloc.c \
-f test/common_amd64/functions/getcwd.c \
-f test/common_amd64/functions/exit.c \
-f test/common_amd64/functions/file.c \
-f functions/calloc.c \
-f functions/string.c \
-f functions/match.c \
-f functions/file_print.c \
-f test/test27/chdir.c \
--debug \
-o test/test27/chdir.M1 || exit 1
# Build debug footer
blood-elf --64 -f test/test27/chdir.M1 \
-o test/test27/chdir-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro
M1 -f test/common_amd64/amd64_defs.M1 \
-f test/common_amd64/libc-core.M1 \
-f test/test27/chdir.M1 \
-f test/test27/chdir-footer.M1 \
--LittleEndian \
--architecture amd64 \
-o test/test27/chdir.hex2 || exit 2
-o test/test27/chdir.hex2 || exit 3
# Resolve all linkages
hex2 -f test/common_amd64/ELF-amd64.hex2 -f test/test27/chdir.hex2 --LittleEndian --architecture amd64 --BaseAddress 0x00600000 -o test/results/test27-amd64-binary --exec_enable || exit 3
hex2 -f test/common_amd64/ELF-amd64-debug.hex2 \
-f test/test27/chdir.hex2 \
--LittleEndian \
--architecture amd64 \
--BaseAddress 0x00600000 \
-o test/results/test27-amd64-binary \
--exec_enable || exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "amd64" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test27-amd64-binary
[ 0 = $? ] || exit 4
. ./sha256.sh
# Verify that the resulting file works
./test/results/test27-amd64-binary
[ 0 = $? ] || exit 5
fi
exit 0

View File

@ -18,35 +18,47 @@
set -x
# Build the test
bin/M2-Planet --architecture armv7l \
-f test/common_armv7l/functions/chdir.c \
-f test/common_armv7l/functions/malloc.c \
-f test/common_armv7l/functions/getcwd.c \
-f test/common_armv7l/functions/exit.c \
-f test/common_armv7l/functions/file.c \
-f functions/calloc.c \
-f functions/string.c \
-f functions/match.c \
-f functions/file_print.c \
-f test/test27/chdir.c \
-f test/common_armv7l/functions/chdir.c \
-f test/common_armv7l/functions/malloc.c \
-f test/common_armv7l/functions/getcwd.c \
-f test/common_armv7l/functions/exit.c \
-f test/common_armv7l/functions/file.c \
-f functions/calloc.c \
-f functions/string.c \
-f functions/match.c \
-f functions/file_print.c \
-f test/test27/chdir.c \
--debug \
-o test/test27/chdir.M1 || exit 1
# Build debug footer
blood-elf -f test/test27/chdir.M1 \
-o test/test27/chdir-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro
M1 -f test/common_armv7l/armv7l_defs.M1 \
-f test/common_armv7l/libc-core.M1 \
-f test/test27/chdir.M1 \
-f test/test27/chdir-footer.M1 \
--LittleEndian \
--architecture armv7l \
-o test/test27/chdir.hex2 || exit 2
-o test/test27/chdir.hex2 || exit 3
# Resolve all linkages
hex2 -f test/common_armv7l/ELF-armv7l.hex2 -f test/test27/chdir.hex2 --LittleEndian --architecture armv7l --BaseAddress 0x10000 -o test/results/test27-armv7l-binary --exec_enable || exit 3
hex2 -f test/common_armv7l/ELF-armv7l-debug.hex2 \
-f test/test27/chdir.hex2 \
--LittleEndian \
--architecture armv7l \
--BaseAddress 0x10000 \
-o test/results/test27-armv7l-binary \
--exec_enable || exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "armv7l" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test27-armv7l-binary
[ 0 = $? ] || exit 4
. ./sha256.sh
# Verify that the resulting file works
./test/results/test27-armv7l-binary
[ 0 = $? ] || exit 5
fi
exit 0

View File

@ -18,16 +18,17 @@
set -x
# Build the test
bin/M2-Planet --architecture knight-posix \
-f test/common_knight/functions/chdir.c \
-f test/common_knight/functions/malloc.c \
-f test/common_knight/functions/getcwd.c \
-f test/common_knight/functions/exit.c \
-f test/common_knight/functions/file.c \
-f functions/calloc.c \
-f functions/string.c \
-f functions/match.c \
-f functions/file_print.c \
-f test/test27/chdir.c \
-f test/common_knight/functions/chdir.c \
-f test/common_knight/functions/malloc.c \
-f test/common_knight/functions/getcwd.c \
-f test/common_knight/functions/exit.c \
-f test/common_knight/functions/file.c \
-f functions/calloc.c \
-f functions/string.c \
-f functions/match.c \
-f functions/file_print.c \
-f test/test27/chdir.c \
--debug \
-o test/test27/chdir.M1 || exit 1
# Macro assemble with libc written in M1-Macro
@ -36,17 +37,23 @@ M1 -f test/common_knight/knight_defs.M1 \
-f test/test27/chdir.M1 \
--BigEndian \
--architecture knight-posix \
-o test/test27/chdir.hex2 || exit 2
-o test/test27/chdir.hex2 || exit 3
# Resolve all linkages
hex2 -f test/test27/chdir.hex2 --BigEndian --architecture knight-posix --BaseAddress 0x0 -o test/results/test27-knight-posix-binary --exec_enable || exit 3
hex2 -f test/common_knight/ELF-knight.hex2 \
-f test/test27/chdir.hex2 \
--BigEndian \
--architecture knight-posix \
--BaseAddress 0x0 \
-o test/results/test27-knight-posix-binary \
--exec_enable || exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "knight*" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test27-knight-posix-binary
[ 0 = $? ] || exit 4
. ./sha256.sh
# Verify that the resulting file works
./test/results/test27-knight-posix-binary
[ 0 = $? ] || exit 5
fi
exit 0

View File

@ -18,37 +18,49 @@
set -x
# Build the test
bin/M2-Planet --architecture x86 \
-f test/common_x86/functions/chdir.c \
-f test/common_x86/functions/malloc.c \
-f test/common_x86/functions/getcwd.c \
-f test/common_x86/functions/fork.c \
-f test/common_x86/functions/execve.c \
-f test/common_x86/functions/exit.c \
-f test/common_x86/functions/file.c \
-f functions/calloc.c \
-f functions/string.c \
-f functions/match.c \
-f functions/file_print.c \
-f test/test27/chdir.c \
-f test/common_x86/functions/chdir.c \
-f test/common_x86/functions/malloc.c \
-f test/common_x86/functions/getcwd.c \
-f test/common_x86/functions/fork.c \
-f test/common_x86/functions/execve.c \
-f test/common_x86/functions/exit.c \
-f test/common_x86/functions/file.c \
-f functions/calloc.c \
-f functions/string.c \
-f functions/match.c \
-f functions/file_print.c \
-f test/test27/chdir.c \
--debug \
-o test/test27/chdir.M1 || exit 1
# Build debug footer
blood-elf -f test/test27/chdir.M1 \
-o test/test27/chdir-footer.M1 || exit 2
# Macro assemble with libc written in M1-Macro
M1 -f test/common_x86/x86_defs.M1 \
-f test/common_x86/libc-core.M1 \
-f test/test27/chdir.M1 \
-f test/test27/chdir-footer.M1 \
--LittleEndian \
--architecture x86 \
-o test/test27/chdir.hex2 || exit 2
-o test/test27/chdir.hex2 || exit 3
# Resolve all linkages
hex2 -f test/common_x86/ELF-i386.hex2 -f test/test27/chdir.hex2 --LittleEndian --architecture x86 --BaseAddress 0x8048000 -o test/results/test27-x86-binary --exec_enable || exit 3
hex2 -f test/common_x86/ELF-i386-debug.hex2 \
-f test/test27/chdir.hex2 \
--LittleEndian \
--architecture x86 \
--BaseAddress 0x8048000 \
-o test/results/test27-x86-binary \
--exec_enable || exit 4
# Ensure binary works if host machine supports test
if [ "$(get_machine ${GET_MACHINE_FLAGS})" = "x86" ]
then
. ./sha256.sh
# Verify that the resulting file works
./test/results/test27-x86-binary
[ 0 = $? ] || exit 4
. ./sha256.sh
# Verify that the resulting file works
./test/results/test27-x86-binary
[ 0 = $? ] || exit 5
fi
exit 0