From: Arch Librarian Date: Thu, 14 Jul 2005 13:06:38 +0000 (+0000) Subject: 2005-03-29 Tollef Fog Heen X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=96d4dc19c74e56f04bb653489511407cc6f75b13;p=pkg-config 2005-03-29 Tollef Fog Heen Author: tfheen Date: 2005-03-29 07:09:37 GMT 2005-03-29 Tollef Fog Heen * check/check-cflags, check/check-define-variable, check/check-libs, check/common, check/Makefile.am, check/simple.pc: Add simple test framework and begin writing tests. * Makefile.am, configure.in: Make in check/ as well. --- diff --git a/ChangeLog b/ChangeLog index 0036207..4341a6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2005-03-29 Tollef Fog Heen + + * check/check-cflags, check/check-define-variable, + check/check-libs, check/common, check/Makefile.am, + check/simple.pc: Add simple test framework and begin writing + tests. + + * Makefile.am, configure.in: Make in check/ as well. + 2005-03-28 Tollef Fog Heen * glib-patches/distcheckfix.diff: Add some files to CLEANFILES so diff --git a/Makefile.am b/Makefile.am index b0eda07..6100ad8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,7 @@ if USE_INSTALLED_GLIB included_glib_includes = @GLIB_CFLAGS@ pkg_config_LDADD=@GLIB_LIBS@ else -SUBDIRS = glib-1.2.8 +SUBDIRS = glib-1.2.8 check included_glib_includes = -I./glib-1.2.8 pkg_config_LDADD=glib-1.2.8/libglib.la endif diff --git a/check/Makefile.am b/check/Makefile.am new file mode 100644 index 0000000..e0f0040 --- /dev/null +++ b/check/Makefile.am @@ -0,0 +1,3 @@ + +TESTS = check-cflags check-libs check-define-variable +EXTRA_DIST = $(TESTS) common simple.pc \ No newline at end of file diff --git a/check/check-cflags b/check/check-cflags new file mode 100755 index 0000000..46af744 --- /dev/null +++ b/check/check-cflags @@ -0,0 +1,10 @@ +#! /bin/sh + +set -e + +. ${srcdir}/common + +ARGS="--cflags simple" +RESULT="" + +run_test diff --git a/check/check-define-variable b/check/check-define-variable new file mode 100755 index 0000000..e0e0880 --- /dev/null +++ b/check/check-define-variable @@ -0,0 +1,10 @@ +#! /bin/sh + +set -e + +. ${srcdir}/common + +ARGS="--define-variable=includedir=/includedir/ --cflags simple" +RESULT="-I/includedir/" + +run_test diff --git a/check/check-libs b/check/check-libs new file mode 100755 index 0000000..0572e9a --- /dev/null +++ b/check/check-libs @@ -0,0 +1,10 @@ +#! /bin/sh + +set -e + +. ${srcdir}/common + +ARGS="--libs simple" +RESULT="-lsimple" + +run_test diff --git a/check/common b/check/common new file mode 100644 index 0000000..2300e4e --- /dev/null +++ b/check/common @@ -0,0 +1,26 @@ +# -*- 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 + +run_test () { + ${pkgconfig} $ARGS >/dev/null 2>&1 + if [ "$?" -ne "0" ]; then + echo "Running ${pkgconfig} $ARGS failed altogether, bailing" + exit 1 + fi + + R=$(${pkgconfig} $ARGS | sed -e 's,^[[:space:]]*,,' -e 's,[[:space:]]*$,,') + if [ "$R" != "$RESULT" ]; then + echo "${pkgconfig} $ARGS :" + echo "'$R' != '$RESULT'" + exit 1 + fi + return +} diff --git a/check/simple.pc b/check/simple.pc new file mode 100644 index 0000000..c898313 --- /dev/null +++ b/check/simple.pc @@ -0,0 +1,11 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: Simple test +Description: Dummy pkgconfig test package for testing pkgconfig +Version: 1.0.0 +Requires: +Libs: -lsimple +Cflags: -I${includedir} diff --git a/configure.in b/configure.in index 9bc0450..3010b8f 100644 --- a/configure.in +++ b/configure.in @@ -67,4 +67,4 @@ AC_FUNC_ALLOCA AC_CHECK_FUNCS(setresuid setreuid,break) AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h]) -AC_OUTPUT([Makefile]) +AC_OUTPUT([Makefile check/Makefile])