Blame gnulib-tests/test-xalloc-die.sh

Packit 33f14e
#!/bin/sh
Packit 33f14e
# Test suite for xalloc_die.
Packit 33f14e
# Copyright (C) 2009-2017 Free Software Foundation, Inc.
Packit 33f14e
# This file is part of the GNUlib Library.
Packit 33f14e
#
Packit 33f14e
# This program is free software: you can redistribute it and/or modify
Packit 33f14e
# it under the terms of the GNU General Public License as published by
Packit 33f14e
# the Free Software Foundation; either version 3 of the License, or
Packit 33f14e
# (at your option) any later version.
Packit 33f14e
#
Packit 33f14e
# This program is distributed in the hope that it will be useful,
Packit 33f14e
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 33f14e
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit 33f14e
# GNU General Public License for more details.
Packit 33f14e
#
Packit 33f14e
# You should have received a copy of the GNU General Public License
Packit 33f14e
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
Packit 33f14e
Packit 33f14e
. "${srcdir=.}/init.sh"; path_prepend_ .
Packit 33f14e
Packit 33f14e
test-xalloc-die${EXEEXT} > out 2> err
Packit 33f14e
case $? in
Packit 33f14e
  1) ;;
Packit 33f14e
  *) Exit 1;;
Packit 33f14e
esac
Packit 33f14e
Packit 33f14e
tr -d '\015' < err \
Packit 33f14e
  | sed 's,.*test-xalloc-die[.ex]*:,test-xalloc-die:,' > err2 || Exit 1
Packit 33f14e
Packit 33f14e
compare - err2 <<\EOF || Exit 1
Packit 33f14e
test-xalloc-die: memory exhausted
Packit 33f14e
EOF
Packit 33f14e
Packit 33f14e
test -s out && Exit 1
Packit 33f14e
Packit 33f14e
Exit $fail