summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2005-07-14 13:06:38 +0000
committerArch Librarian <arch@canonical.com>2005-07-14 13:06:38 +0000
commit96d4dc19c74e56f04bb653489511407cc6f75b13 (patch)
treefb8d5c896488ab6d340210ac0fe5470428341890 /check
parent61efa4f6c4be1a1f1ad59978f47106540730ceae (diff)
downloadpkg-config-96d4dc19c74e56f04bb653489511407cc6f75b13.tar.gz
2005-03-29 Tollef Fog Heen <tfheen@err.no>
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.
Diffstat (limited to 'check')
-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
6 files changed, 70 insertions, 0 deletions
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}