2 # Copyright (C) 2005-2012 Red Hat, Inc.
3 # This file is part of Red Hat elfutils.
5 # Red Hat elfutils is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by the
7 # Free Software Foundation; version 2 of the License.
9 # Red Hat elfutils is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 # General Public License for more details.
14 # You should have received a copy of the GNU General Public License along
15 # with Red Hat elfutils; if not, write to the Free Software Foundation,
16 # Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA.
18 # Red Hat elfutils is an included package of the Open Invention Network.
19 # An included package of the Open Invention Network is a package for which
20 # Open Invention Network licensees cross-license their patents. No patent
21 # license is granted, either expressly or impliedly, by designation as an
22 # included package. Should you wish to participate in the Open Invention
23 # Network licensing program, please visit www.openinventionnetwork.com
24 # <http://www.openinventionnetwork.com>.
27 # This file is sourced by ". $srcdir/test-subr.sh" at the start of
28 # each test script. It defines some functions they use and sets up
29 # canonical sh state for test runs.
37 trap 'rm -f $remove_files' 0
41 remove_files="$remove_files $*"
47 bunzip2 -c $srcdir/${file}.bz2 > ${file} 2>/dev/null || exit 77
48 remove_files="$remove_files $file"
56 remove_files="$remove_files $outfile"
57 testrun "$@" > $outfile 2>&1 || :
62 outfile="${1##*/}.out"
63 testrun_out $outfile "$@"
65 # diff's exit status will kill the script.
74 # See test-wrapper.sh, which sets the environment for this.
77 ${elfutils_testrun}_testrun "$@"
82 LD_LIBRARY_PATH="${built_library_path}${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"\
92 if [ "x$elfutils_tests_rpath" != xno ]; then
93 echo >&2 installcheck not possible with --enable-tests-rpath
98 program=${bindir}/`program_transform ${program##*/}`
101 if [ "${libdir}" != /usr/lib ] && [ "${libdir}" != /usr/lib64 ]; then
102 LD_LIBRARY_PATH="${libdir}:${libdir}/elfutils\
103 ${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH" \
112 echo "$*" | sed "${program_transform_name}"