mirror of
https://gitlab.freedesktop.org/pkg-config/pkg-config.git
synced 2026-05-04 02:27:58 +02:00
By specifying the pkg-config to use for testing from make, we can easily control its path and add the .exe extension for Windows. It also allows easy testing of another pkg-config from make: make check TESTS_PKG_CONFIG=/usr/bin/pkg-config
33 lines
710 B
Bash
33 lines
710 B
Bash
# -*- sh -*-
|
|
#
|
|
# This file is sourced by the different test scripts. It needs to be
|
|
# valid POSIX sh.
|
|
#
|
|
|
|
pkgconfig=${PKG_CONFIG-../pkg-config}
|
|
|
|
. ./config.sh
|
|
|
|
unset PKG_CONFIG_PATH
|
|
PKG_CONFIG_LIBDIR=$srcdir
|
|
export PKG_CONFIG_LIBDIR
|
|
export LC_ALL=C
|
|
|
|
run_test () {
|
|
set +e
|
|
${pkgconfig} $ARGS >/dev/null 2>&1
|
|
R=$?
|
|
if [ "$R" -ne "${EXPECT_RETURN:-0}" ]; then
|
|
${pkgconfig} --print-errors $ARGS
|
|
echo "${pkgconfig} $ARGS exited with $R (expected ${EXPECT_RETURN:-0})" 1>&2
|
|
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
|
|
}
|