]> err.no Git - pkg-config/commitdiff
2005-03-29 Tollef Fog Heen <tfheen@err.no>
authorArch Librarian <arch@canonical.com>
Thu, 14 Jul 2005 13:06:38 +0000 (13:06 +0000)
committerArch Librarian <arch@canonical.com>
Thu, 14 Jul 2005 13:06:38 +0000 (13:06 +0000)
Author: tfheen
Date: 2005-03-29 07:09:37 GMT
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.

ChangeLog
Makefile.am
check/Makefile.am [new file with mode: 0644]
check/check-cflags [new file with mode: 0755]
check/check-define-variable [new file with mode: 0755]
check/check-libs [new file with mode: 0755]
check/common [new file with mode: 0644]
check/simple.pc [new file with mode: 0644]
configure.in

index 00362079864b2a40411afb2e46ebac64142dbc63..4341a6bcb29bd26b2fbd820d74381f3c9946ba22 100644 (file)
--- 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
index b0eda0789223b1d26237247e1c6025ff5ac2b1c7..6100ad8834e8264ef10f7ab4e4d66064f103b771 100644 (file)
@@ -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 (file)
index 0000000..e0f0040
--- /dev/null
@@ -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 (executable)
index 0000000..46af744
--- /dev/null
@@ -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 (executable)
index 0000000..e0e0880
--- /dev/null
@@ -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 (executable)
index 0000000..0572e9a
--- /dev/null
@@ -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 (file)
index 0000000..2300e4e
--- /dev/null
@@ -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 (file)
index 0000000..c898313
--- /dev/null
@@ -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}
index 9bc0450a546ed9a644227b95f48233aa7361f4c9..3010b8fe5aa313cf9489d949233f5d098bd1a3d0 100644 (file)
@@ -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])