summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorTollef Fog Heen <tfheen@err.no>2010-05-23 22:59:46 +0200
committerTollef Fog Heen <tfheen@err.no>2010-05-23 23:11:40 +0200
commit69a7eaa6763bb0920e2b539fffbad51348d94deb (patch)
tree6b76512cc576bcca54ec278078321e597498bf43 /check
parent5ade770f7698818db01626c6b3b28d0f0bec6ad1 (diff)
downloadpkg-config-69a7eaa6763bb0920e2b539fffbad51348d94deb.tar.gz
Make it possible to escape paths containing special shell characters
Allow paths and other components to contain shell metacharacters, but escape them on output. White space has to be escaped in the input files using quotes or backslashes Freedesktop.org #3571
Diffstat (limited to 'check')
-rw-r--r--check/Makefile.am4
-rwxr-xr-xcheck/check-whitespace20
-rw-r--r--check/whitespace.pc11
3 files changed, 33 insertions, 2 deletions
diff --git a/check/Makefile.am b/check/Makefile.am
index 335d6fe..39ba7c8 100644
--- a/check/Makefile.am
+++ b/check/Makefile.am
@@ -1,10 +1,10 @@
TESTS = check-cflags check-libs check-define-variable \
check-libs-private check-requires-private check-includedir \
- check-conflicts check-missing check-idirafter
+ check-conflicts check-missing check-idirafter check-whitespace
EXTRA_DIST = $(TESTS) common simple.pc requires-test.pc public-dep.pc \
private-dep.pc includedir.pc missing-requires-private.pc \
- missing-requires.pc idirafter.pc
+ missing-requires.pc idirafter.pc whitespace.pc
DISTCLEANFILES = config.sh
diff --git a/check/check-whitespace b/check/check-whitespace
new file mode 100755
index 0000000..38de0e8
--- /dev/null
+++ b/check/check-whitespace
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+# Make sure we're POSIX
+if [ "$PKG_CONFIG_SHELL_IS_POSIX" != "1" ]; then
+ PKG_CONFIG_SHELL_IS_POSIX=1 PATH=`getconf PATH` exec sh $0 "$@"
+fi
+
+set -e
+
+. ${srcdir}/common
+
+# expect cflags from whitespace
+ARGS="--cflags whitespace"
+RESULT="-I/usr/white\\ space/include -Iinclude\\ dir -Iother\\ include\\ dir"
+run_test
+
+# expect libs from whitespace
+ARGS="--libs whitespace"
+RESULT="-L/usr/white\\ space/lib -lfoo\\ bar -lbar\\ baz"
+run_test
diff --git a/check/whitespace.pc b/check/whitespace.pc
new file mode 100644
index 0000000..e9d8488
--- /dev/null
+++ b/check/whitespace.pc
@@ -0,0 +1,11 @@
+prefix=/usr
+exec_prefix=${prefix}
+libdir="${exec_prefix}/white space/lib"
+includedir="${prefix}/white space/include"
+
+Name: Whitespace test
+Description: Dummy pkgconfig test package for testing pkgconfig
+Version: 1.0.0
+Requires:
+Libs: -L${libdir} -lfoo\ bar "-lbar baz"
+Cflags: -I${includedir} -Iinclude\ dir "-Iother include dir"