From 2e7b4df9f7dfd6a4a6796cd2fcee010ea78427ea Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Sun, 17 Dec 2023 13:23:51 +0100 Subject: Miscellaneous improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- tests/archinfo | 17 ++++++++++------- tests/error-search | 13 +++++++++++++ tests/load-archinfo | 7 +++++-- tests/run | 4 ++++ tests/signal-search | 13 +++++++++++++ 5 files changed, 45 insertions(+), 9 deletions(-) create mode 100644 tests/error-search create mode 100644 tests/run create mode 100644 tests/signal-search (limited to 'tests') diff --git a/tests/archinfo b/tests/archinfo index 5034766..334571e 100644 --- a/tests/archinfo +++ b/tests/archinfo @@ -1,19 +1,22 @@ # -*- sh -*- # See LICENSE file for copyright and license details. -printf '%s\n' "$archinfo" | grep '^AMD64 8 64 64 Little TWOS_COMPLEMENT' >/dev/null -printf '%s\n' "$archinfo" | grep '^AMD64_X32 8 32 32 Little TWOS_COMPLEMENT' >/dev/null -printf '%s\n' "$archinfo" | grep '^M68K 8 32 32 Big TWOS_COMPLEMENT' >/dev/null -printf '%s\n' "$archinfo" | grep '^PARISC_32 8 32 32 Big TWOS_COMPLEMENT' >/dev/null -printf '%s\n' "$archinfo" | grep '^PARISC_64 8 64 64 Big TWOS_COMPLEMENT' >/dev/null -printf '%s\n' "$archinfo" | grep '^SPARC_32 8 32 32 Big TWOS_COMPLEMENT' >/dev/null -printf '%s\n' "$archinfo" | grep '^I386 8 32 32 Little TWOS_COMPLEMENT' >/dev/null +printf '%s\n' "$archinfo" | grep '^AMD64 8 64 64 64 Little TWOS_COMPLEMENT' >/dev/null +printf '%s\n' "$archinfo" | grep '^AMD64_X32 8 32 32 64 Little TWOS_COMPLEMENT' >/dev/null +printf '%s\n' "$archinfo" | grep '^M68K 8 32 32 16 Big TWOS_COMPLEMENT' >/dev/null +printf '%s\n' "$archinfo" | grep '^PARISC_32 8 32 32 64 Big TWOS_COMPLEMENT' >/dev/null +printf '%s\n' "$archinfo" | grep '^PARISC_64 8 64 64 64 Big TWOS_COMPLEMENT' >/dev/null +printf '%s\n' "$archinfo" | grep '^SPARC_32 8 32 32 64 Big TWOS_COMPLEMENT' >/dev/null +printf '%s\n' "$archinfo" | grep '^I386 8 32 32 32 Little TWOS_COMPLEMENT' >/dev/null test $(getbytesize AMD64) = 8 test $(getbytesize I386) = 8 test $(getaddrsize I386) = 32 test $(getaddrsize AMD64) = 64 test $(getsizesize AMD64) = 64 test $(getsizesize I386) = 32 +test $(getintalign I386) = 32 +test $(getintalign AMD64) = 64 +test $(getintalign M68K) = 16 test $(getendian I386) = Little test $(getendian AMD64) = Little test $(getendian M68K) = Big diff --git a/tests/error-search b/tests/error-search new file mode 100644 index 0000000..dd71bd9 --- /dev/null +++ b/tests/error-search @@ -0,0 +1,13 @@ +# -*- sh -*- +# See LICENSE file for copyright and license details. + +for os in $(getnamelist OS); do + osn=$(getnum OS $os) + for arch in $(getnamelist ARCH); do + archn=$(getnum ARCH $arch) + if issupported $os $arch; then + p tests/run test-search.tu errors $osn $archn $os $arch + fi + done + await +done diff --git a/tests/load-archinfo b/tests/load-archinfo index e5413b4..8e6b2a6 100644 --- a/tests/load-archinfo +++ b/tests/load-archinfo @@ -33,9 +33,12 @@ getaddrsize () { getsizesize () { printf '%s\n' "$archinfo" | grep "^$1 " | cut -d ' ' -f 4 } -getendian () { +getintalign () { printf '%s\n' "$archinfo" | grep "^$1 " | cut -d ' ' -f 5 } -getsign () { +getendian () { printf '%s\n' "$archinfo" | grep "^$1 " | cut -d ' ' -f 6 } +getsign () { + printf '%s\n' "$archinfo" | grep "^$1 " | cut -d ' ' -f 7 +} diff --git a/tests/run b/tests/run new file mode 100644 index 0000000..c9bd4b6 --- /dev/null +++ b/tests/run @@ -0,0 +1,4 @@ +# -*- sh -*- +# See LICENSE file for copyright and license details. + +"$@" diff --git a/tests/signal-search b/tests/signal-search new file mode 100644 index 0000000..b4afc49 --- /dev/null +++ b/tests/signal-search @@ -0,0 +1,13 @@ +# -*- sh -*- +# See LICENSE file for copyright and license details. + +for os in $(getnamelist OS); do + osn=$(getnum OS $os) + for arch in $(getnamelist ARCH); do + archn=$(getnum ARCH $arch) + if issupported $os $arch; then + p tests/run test-search.tu signals $osn $archn $os $arch + fi + done + await +done -- cgit v1.2.3-70-g09d2