From 4070cc23394a6cec65ba8e8403ac60925a508048 Mon Sep 17 00:00:00 2001 From: Tollef Fog Heen Date: Mon, 30 Mar 2009 20:14:33 +0200 Subject: [PATCH] 2009-03-30 Tollef Fog Heen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * check/common: Add support for non-zero return codes to test framework. Thanks to Loïc Minier for the idea. --- ChangeLog | 3 +++ check/common | 7 ++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7d86de5..c84b1ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-03-30 Tollef Fog Heen + * check/common: Add support for non-zero return codes to test + framework. Thanks to Loïc Minier for the idea. + * pkg.m4: Add PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR to the list of precious directories. (AC_ARG_VAR) diff --git a/check/common b/check/common index 2300e4e..d527f52 100644 --- a/check/common +++ b/check/common @@ -11,12 +11,13 @@ export PKG_CONFIG_PATH run_test () { ${pkgconfig} $ARGS >/dev/null 2>&1 - if [ "$?" -ne "0" ]; then - echo "Running ${pkgconfig} $ARGS failed altogether, bailing" + R=$? + if [ "$R" -ne "${EXPECT_RETURN:-0}" ]; then + echo "${pkgconfig} $ARGS exited with $R (expected $EXPECT_RETURN)" exit 1 fi - R=$(${pkgconfig} $ARGS | sed -e 's,^[[:space:]]*,,' -e 's,[[:space:]]*$,,') + R=$(${pkgconfig} $ARGS 2>&1 | sed -e 's,^[[:space:]]*,,' -e 's,[[:space:]]*$,,') if [ "$R" != "$RESULT" ]; then echo "${pkgconfig} $ARGS :" echo "'$R' != '$RESULT'" -- 2.39.5