Project Info Name.......: gnu-hello
Description: GNU Hello


gnu-hello       
Info
Commit...:113f5b4f7d452442a55c7fe1417b9a2a3cde6287
Author...:Reuben Thomas
Committer:Reuben Thomas
Date.....:Mon Jan 31 18:38:41 2022 +0000
Parents..:66f4cdde6b72b7f2114b0d243ae229541d0b0742

Message
maint: allow atexit-1 test to work when wprintf failed

The test assumed that there was no error before closing stdout. When
there is, the output is different (close_stdout detects a previous
error).

Hence, detect just the “write error” part of the output, which is
constant.

(The other part may depend on the libc anyway.)

Changes
diff --git a/tests/atexit-1 b/tests/atexit-1
line changes: +3/-8
index e10fb41..4b055d7
--- a/tests/atexit-1
+++ b/tests/atexit-1
@@ -1,7 +1,7 @@
 #! /bin/sh
 # Test atexit handling.
 #
-# Copyright (C) 2019 Free Software Foundation, Inc.
+# Copyright (C) 2019-2022 Free Software Foundation, Inc.
 #
 # Copying and distribution of this file, with or without modification,
 # are permitted in any medium without royalty provided the copyright
@@ -14,11 +14,6 @@ if ! [ -c /dev/full ]; then
   exit 77
 fi
 
-tmpfiles="atexit-test1.ok"
-cat <<EOF >atexit-test1.ok
-hello: write error: No space left on device
-EOF
-
 tmpfiles="$tmpfiles atexit-test1.out"
 : ${HELLO=hello}
 ${HELLO} 2>&1 1>/dev/full | tr -d '\r' >atexit-test1.out
@@ -27,8 +22,8 @@ ${HELLO} 2>&1 1>/dev/full | tr -d '\r' >atexit-test1.out
 # platforms with CRLF line endings.  There is apparently no reliable
 # method (across Cygwin, MingW, etc.) to force an eol style.
 
-: ${DIFF=diff}
-${DIFF} atexit-test1.ok atexit-test1.out
+: ${GREP=grep}
+${GREP} "^hello: write error" atexit-test1.out
 result=$?
 
 rm -fr $tmpfiles

This website is licensed under AGPL-3.0. Feel free to copy!