2005-07-14 13:06:38 +00:00
|
|
|
# -*- sh -*-
|
|
|
|
|
#
|
|
|
|
|
# This file is sourced by the different test scripts. It needs to be
|
|
|
|
|
# valid POSIX sh.
|
|
|
|
|
#
|
|
|
|
|
|
2012-08-19 08:30:10 -07:00
|
|
|
pkgconfig=${PKG_CONFIG-../pkg-config}
|
2005-07-14 13:06:38 +00:00
|
|
|
|
2009-06-30 03:47:49 +02:00
|
|
|
. ./config.sh
|
2009-03-30 21:50:01 +02:00
|
|
|
|
2012-05-30 05:45:16 -07:00
|
|
|
unset PKG_CONFIG_PATH
|
|
|
|
|
PKG_CONFIG_LIBDIR=$srcdir
|
|
|
|
|
export PKG_CONFIG_LIBDIR
|
2009-03-30 20:23:04 +02:00
|
|
|
export LC_ALL=C
|
2005-07-14 13:06:38 +00:00
|
|
|
|
|
|
|
|
run_test () {
|
2010-05-27 22:17:54 +02:00
|
|
|
set +e
|
2012-09-29 08:50:57 -07:00
|
|
|
${pkgconfig} "$@" >/dev/null 2>&1
|
2009-03-30 20:14:33 +02:00
|
|
|
R=$?
|
|
|
|
|
if [ "$R" -ne "${EXPECT_RETURN:-0}" ]; then
|
2012-09-29 08:50:57 -07:00
|
|
|
${pkgconfig} --print-errors "$@"
|
|
|
|
|
echo "${pkgconfig} $@ exited with $R (expected ${EXPECT_RETURN:-0})" 1>&2
|
2005-07-14 13:06:38 +00:00
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2012-09-29 08:50:57 -07:00
|
|
|
R=$(${pkgconfig} "$@" 2>&1 | sed -e 's,^[[:space:]]*,,' -e 's,[[:space:]]*$,,')
|
2005-07-14 13:06:38 +00:00
|
|
|
if [ "$R" != "$RESULT" ]; then
|
2012-09-29 08:50:57 -07:00
|
|
|
echo "${pkgconfig} $@ :"
|
2005-07-14 13:06:38 +00:00
|
|
|
echo "'$R' != '$RESULT'"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
return
|
|
|
|
|
}
|