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.
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
pkgconfig=../pkg-config
|
|
|
|
|
|
2009-06-30 03:47:49 +02:00
|
|
|
. ./config.sh
|
2009-03-30 21:50:01 +02:00
|
|
|
|
2005-07-14 13:06:38 +00:00
|
|
|
PKG_CONFIG_PATH=$srcdir
|
|
|
|
|
export PKG_CONFIG_PATH
|
2009-03-30 20:23:04 +02:00
|
|
|
export LC_ALL=C
|
2005-07-14 13:06:38 +00:00
|
|
|
|
|
|
|
|
run_test () {
|
|
|
|
|
${pkgconfig} $ARGS >/dev/null 2>&1
|
2009-03-30 20:14:33 +02:00
|
|
|
R=$?
|
|
|
|
|
if [ "$R" -ne "${EXPECT_RETURN:-0}" ]; then
|
|
|
|
|
echo "${pkgconfig} $ARGS exited with $R (expected $EXPECT_RETURN)"
|
2005-07-14 13:06:38 +00:00
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2009-03-30 20:14:33 +02:00
|
|
|
R=$(${pkgconfig} $ARGS 2>&1 | sed -e 's,^[[:space:]]*,,' -e 's,[[:space:]]*$,,')
|
2005-07-14 13:06:38 +00:00
|
|
|
if [ "$R" != "$RESULT" ]; then
|
|
|
|
|
echo "${pkgconfig} $ARGS :"
|
|
|
|
|
echo "'$R' != '$RESULT'"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
return
|
|
|
|
|
}
|