From 00893e79fc62966067af1a106567db96bd170338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 3 Mar 2024 19:11:32 +0100 Subject: New upstream version 1.2 --- tests/test-error.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 tests/test-error.sh (limited to 'tests/test-error.sh') diff --git a/tests/test-error.sh b/tests/test-error.sh new file mode 100755 index 00000000..d173e183 --- /dev/null +++ b/tests/test-error.sh @@ -0,0 +1,36 @@ +#!/bin/sh +# Test of the 'error' module. + +. "${srcdir=.}/init.sh"; path_prepend_ . + +${CHECKER} test-error${EXEEXT} > out 2> err +# Verify the exit code. +case $? in + 4) ;; + *) Exit 1;; +esac + +# Normalize the stderr output on Windows platforms. +tr -d '\015' < err | sed 's,.*test-error[.ex]*:,test-error:,' > err2 || Exit 1 + +# Verify the stderr output. +compare - err2 <<\EOF || Exit 1 +test-error: bummer +test-error: Zonk 123 is too large +test-error: Pokémon started +test-error:d1/foo.c:10: invalid blub +test-error:d1/foo.c:10: invalid blarn +test-error:d1/foo.c:10: unsupported glink +test-error:d1/foo.c:13: invalid brump +test-error:d2/foo.c:13: unsupported flinge +hammer +boing 123 is too large +d2/bar.c:11: bark too loud +test-error: can't steal: Permission denied +test-error: fatal error +EOF + +# Verify the stdout output. +test -s out && Exit 1 + +Exit 0 -- cgit v1.2.3