From 6d77b155bcd4725e09837604e6ea86f5f124ba9c Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Tue, 5 Dec 2023 20:10:48 +0100 Subject: Third commit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- tests/signals | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 tests/signals (limited to 'tests/signals') diff --git a/tests/signals b/tests/signals new file mode 100644 index 0000000..7e58621 --- /dev/null +++ b/tests/signals @@ -0,0 +1,43 @@ +# -*- 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) + get-signals.tu $osn $archn $os $arch > $a + grep -v '^[0-9]\+ -' >/dev/null < $a + grep -v '^-' < $a > $b + grep '^\([0-9]\+\) \1 ' < $a | diff -u $a - + if issupported $os $arch; then + (! test "$(cat $a)" = x) + if test "$os" = LINUX; then + signed=1 + grep '^[0-9]\+ [0-9]\+ [A-Z0-9_+]\+$' >/dev/null < $a + test -z "$(grep -v '^[0-9]\+ [0-9]\+ [A-Z0-9_+]\+$' < $a)" + required="SIGKILL SIGTERM SIGCONT SIGSTOP SIGHUP _SIGRTMIN _SIGRTMIN+8" + else + continue; + fi + for req in $required; do + grep '^-\?[0-9]\+ [0-9]\+ '"$req"\$ >/dev/null < $a + done + cut -d ' ' -f $(( 2 - signed )) < $a > $b && sort -n < $b | diff -u $b - + if test -f testcases/signals-$os-$arch; then + if ! diff -u testcases/signals-$os-$arch $a; then + printf '\x1b[33m%s\x1b[m\n' "Maybe new signals have been added for $os on $arch" + exit 1 + fi + fi + else + # Can still be successful because it may be hardcorded to + # use the same table as another architecture that is supported, + # however it cannot be successful if the OS is not supported + issupported $os + fi + test -z "$(cut -d ' ' -f 1 < $a | sort | uniq -d)" + test -z "$(cut -d ' ' -f 2 < $a | sort | uniq -d)" + test -z "$(cut -d ' ' -f 3 < $a | sort | uniq -d)" + done +done +test -f testcases/signals-LINUX-AMD64 -- cgit v1.2.3-70-g09d2