pkg-config/check/common
Tollef Fog Heen 34657e444f 2009-03-30 Tollef Fog Heen <tfheen@err.no>
* check/common: Run all tests in the C locale
2009-03-30 20:23:04 +02:00

28 lines
599 B
Bash

# -*- sh -*-
#
# This file is sourced by the different test scripts. It needs to be
# valid POSIX sh.
#
pkgconfig=../pkg-config
PKG_CONFIG_PATH=$srcdir
export PKG_CONFIG_PATH
export LC_ALL=C
run_test () {
${pkgconfig} $ARGS >/dev/null 2>&1
R=$?
if [ "$R" -ne "${EXPECT_RETURN:-0}" ]; then
echo "${pkgconfig} $ARGS exited with $R (expected $EXPECT_RETURN)"
exit 1
fi
R=$(${pkgconfig} $ARGS 2>&1 | sed -e 's,^[[:space:]]*,,' -e 's,[[:space:]]*$,,')
if [ "$R" != "$RESULT" ]; then
echo "${pkgconfig} $ARGS :"
echo "'$R' != '$RESULT'"
exit 1
fi
return
}