summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--Makefile.am2
-rw-r--r--check/Makefile.am3
-rwxr-xr-xcheck/check-cflags10
-rwxr-xr-xcheck/check-define-variable10
-rwxr-xr-xcheck/check-libs10
-rw-r--r--check/common26
-rw-r--r--check/simple.pc11
-rw-r--r--configure.in2
9 files changed, 81 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0036207..4341a6b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+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
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])