[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
test-xalloc-die buglet
From: |
Simon Josefsson |
Subject: |
test-xalloc-die buglet |
Date: |
Tue, 17 Nov 2009 19:58:39 +0100 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux) |
I noticed an EOL problem on mingw and pushed the fix below.
/Simon
>From 3e00f5fce5b904dc642aff88abbcf75867263e0a Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Tue, 17 Nov 2009 19:58:12 +0100
Subject: [PATCH] tests/test-xalloc-die.sh: Deal with EOL differences, and more.
---
ChangeLog | 5 +++++
tests/test-xalloc-die.sh | 31 ++++++++++++++++++++++++++++---
2 files changed, 33 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 4dbb0d3..0989d4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2009-11-17 Simon Josefsson <address@hidden>
+
+ * tests/test-xalloc-die.sh: Add license. Check that nothing is
+ printed to stdout. Deal with EOL differences.
+
2009-11-17 Eric Blake <address@hidden>
unsetenv: work around Solaris bug
diff --git a/tests/test-xalloc-die.sh b/tests/test-xalloc-die.sh
index b181ccb..dc9bc37 100755
--- 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 @@ else
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
--
1.6.5.2
- test-xalloc-die buglet,
Simon Josefsson <=