+2005-03-29 Tollef Fog Heen <tfheen@err.no>
+
+ * 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 <tfheen@err.no>
* glib-patches/distcheckfix.diff: Add some files to CLEANFILES so
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
--- /dev/null
+
+TESTS = check-cflags check-libs check-define-variable
+EXTRA_DIST = $(TESTS) common simple.pc
\ No newline at end of file
--- /dev/null
+#! /bin/sh
+
+set -e
+
+. ${srcdir}/common
+
+ARGS="--cflags simple"
+RESULT=""
+
+run_test
--- /dev/null
+#! /bin/sh
+
+set -e
+
+. ${srcdir}/common
+
+ARGS="--define-variable=includedir=/includedir/ --cflags simple"
+RESULT="-I/includedir/"
+
+run_test
--- /dev/null
+#! /bin/sh
+
+set -e
+
+. ${srcdir}/common
+
+ARGS="--libs simple"
+RESULT="-lsimple"
+
+run_test
--- /dev/null
+# -*- 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
+}
--- /dev/null
+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}
AC_CHECK_FUNCS(setresuid setreuid,break)
AC_CHECK_HEADERS([dirent.h unistd.h sys/wait.h])
-AC_OUTPUT([Makefile])
+AC_OUTPUT([Makefile check/Makefile])