Mercurial > gnulib
annotate tests/test-xalloc-die.sh @ 40221:8c1a17df67e0
tests: Prepare for using valgrind.
tests/*.sh: Invoke all test programs through ${CHECKER}.
tests/*/*.sh: Likewise.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sun, 10 Mar 2019 11:32:11 +0100 |
parents | b06060465f09 |
children |
rev | line source |
---|---|
12301
8cf4c5e7274b
xalloc-die-tests: avoid printing null pointer
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
1 #!/bin/sh |
12308
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
2 # Test suite for xalloc_die. |
40057
b06060465f09
maint: Run 'make update-copyright'
Paul Eggert <eggert@cs.ucla.edu>
parents:
19484
diff
changeset
|
3 # Copyright (C) 2009-2019 Free Software Foundation, Inc. |
12308
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
4 # This file is part of the GNUlib Library. |
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
5 # |
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
6 # This program is free software: you can redistribute it and/or modify |
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
7 # it under the terms of the GNU General Public License as published by |
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
8 # the Free Software Foundation; either version 3 of the License, or |
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
9 # (at your option) any later version. |
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
10 # |
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
11 # This program is distributed in the hope that it will be useful, |
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
14 # GNU General Public License for more details. |
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
15 # |
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
16 # You should have received a copy of the GNU General Public License |
19190 | 17 # along with this program. If not, see <https://www.gnu.org/licenses/>. |
12301
8cf4c5e7274b
xalloc-die-tests: avoid printing null pointer
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
18 |
12404
44954971957b
init.sh: avoid Solaris 10 /bin/sh portability problem
Jim Meyering <meyering@redhat.com>
parents:
12389
diff
changeset
|
19 . "${srcdir=.}/init.sh"; path_prepend_ . |
12301
8cf4c5e7274b
xalloc-die-tests: avoid printing null pointer
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
20 |
40221
8c1a17df67e0
tests: Prepare for using valgrind.
Bruno Haible <bruno@clisp.org>
parents:
40057
diff
changeset
|
21 ${CHECKER} test-xalloc-die${EXEEXT} > out 2> err |
12301
8cf4c5e7274b
xalloc-die-tests: avoid printing null pointer
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
22 case $? in |
8cf4c5e7274b
xalloc-die-tests: avoid printing null pointer
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
23 1) ;; |
12389
cfc6e617b290
test-xalloc-die: fix test for mingw
Eric Blake <ebb9@byu.net>
parents:
12369
diff
changeset
|
24 *) Exit 1;; |
12301
8cf4c5e7274b
xalloc-die-tests: avoid printing null pointer
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
25 esac |
8cf4c5e7274b
xalloc-die-tests: avoid printing null pointer
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
26 |
12389
cfc6e617b290
test-xalloc-die: fix test for mingw
Eric Blake <ebb9@byu.net>
parents:
12369
diff
changeset
|
27 tr -d '\015' < err \ |
cfc6e617b290
test-xalloc-die: fix test for mingw
Eric Blake <ebb9@byu.net>
parents:
12369
diff
changeset
|
28 | sed 's,.*test-xalloc-die[.ex]*:,test-xalloc-die:,' > err2 || Exit 1 |
12308
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
29 |
12389
cfc6e617b290
test-xalloc-die: fix test for mingw
Eric Blake <ebb9@byu.net>
parents:
12369
diff
changeset
|
30 compare - err2 <<\EOF || Exit 1 |
12301
8cf4c5e7274b
xalloc-die-tests: avoid printing null pointer
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
31 test-xalloc-die: memory exhausted |
8cf4c5e7274b
xalloc-die-tests: avoid printing null pointer
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
32 EOF |
8cf4c5e7274b
xalloc-die-tests: avoid printing null pointer
Eric Blake <ebb9@byu.net>
parents:
diff
changeset
|
33 |
12389
cfc6e617b290
test-xalloc-die: fix test for mingw
Eric Blake <ebb9@byu.net>
parents:
12369
diff
changeset
|
34 test -s out && Exit 1 |
12308
5dd13836d207
tests/test-xalloc-die.sh: Deal with EOL differences, and more.
Simon Josefsson <simon@josefsson.org>
parents:
12304
diff
changeset
|
35 |
12389
cfc6e617b290
test-xalloc-die: fix test for mingw
Eric Blake <ebb9@byu.net>
parents:
12369
diff
changeset
|
36 Exit $fail |