changeset 12308:5dd13836d207

tests/test-xalloc-die.sh: Deal with EOL differences, and more.
author Simon Josefsson <simon@josefsson.org>
date Tue, 17 Nov 2009 19:58:12 +0100
parents a15e71d9f0b6
children b72afd7a0c20
files ChangeLog tests/test-xalloc-die.sh
diffstat 2 files changed, 33 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-17  Simon Josefsson  <simon@josefsson.org>
+
+	* tests/test-xalloc-die.sh: Add license.  Check that nothing is
+	printed to stdout.  Deal with EOL differences.
+
 2009-11-17  Eric Blake  <ebb9@byu.net>
 
 	unsetenv: work around Solaris bug
--- a/tests/test-xalloc-die.sh
+++ b/tests/test-xalloc-die.sh
@@ -1,4 +1,20 @@
 #!/bin/sh
+# Test suite for xalloc_die.
+# Copyright (C) 2009 Free Software Foundation, Inc.
+# This file is part of the GNUlib Library.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 tmpfiles=""
 trap '__st=$?; rm -fr $tmpfiles; exit $__st' 0
@@ -12,19 +28,28 @@
   compare() { cmp "$@"; }
 fi
 
-tmpfiles="t-xalloc-die.tmp"
+tmpout=t-xalloc-die.tmp-stderr
+tmperr=t-xalloc-die.tmp-stdout
+tmpfiles="$tmpout $tmperr ${tmpout}2 ${tmperr}2"
+
 PATH=".:$PATH"
 export PATH
-test-xalloc-die${EXEEXT} 2> t-xalloc-die.tmp
+test-xalloc-die${EXEEXT} 2> ${tmperr} > ${tmpout}
 case $? in
   1) ;;
   *) (exit 1); exit 1 ;;
 esac
 
-compare - t-xalloc-die.tmp <<\EOF || { (exit 1); exit 1; }
+cat $tmperr | tr -d '\015' > ${tmperr}2
+cat $tmpout | tr -d '\015' > ${tmpout}2
+
+compare - ${tmperr}2 <<\EOF || { (exit 1); exit 1; }
 test-xalloc-die: memory exhausted
 EOF
 
+compare - ${tmpout}2 <<\EOF || { (exit 1); exit 1; }
+EOF
+
 rm -fr $tmpfiles
 
 exit 0