From a3fa9732b30fda05ae3d4d92acc0c249e2aa09e5 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Sat, 25 Feb 2017 13:57:38 -0600 Subject: [PATCH] testsuite: add testsuite cases for inverse quoting situations --- Makefile.am | 3 +++ tests/lib1/fragment-quoting-4.pc | 10 ++++++++++ tests/lib1/fragment-quoting-5.pc | 10 ++++++++++ tests/lib1/fragment-quoting-6.pc | 10 ++++++++++ tests/parser.sh | 29 ++++++++++++++++++++++++++++- 5 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 tests/lib1/fragment-quoting-4.pc create mode 100644 tests/lib1/fragment-quoting-5.pc create mode 100644 tests/lib1/fragment-quoting-6.pc diff --git a/Makefile.am b/Makefile.am index 1fb61a6..48dd1f0 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,6 +68,9 @@ EXTRA_DIST = pkg.m4 \ tests/lib1/fragment-quoting.pc \ tests/lib1/fragment-quoting-2.pc \ tests/lib1/fragment-quoting-3.pc \ + tests/lib1/fragment-quoting-4.pc \ + tests/lib1/fragment-quoting-5.pc \ + tests/lib1/fragment-quoting-6.pc \ tests/test_env.sh \ $(test_scripts) \ doc/conf.py \ diff --git a/tests/lib1/fragment-quoting-4.pc b/tests/lib1/fragment-quoting-4.pc new file mode 100644 index 0000000..f35e0ed --- /dev/null +++ b/tests/lib1/fragment-quoting-4.pc @@ -0,0 +1,10 @@ +prefix=/test +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: fragment-quoting-4 +Description: A testing pkg-config file +Version: 1.2.3 +Cflags: -fPIC -I${includedir}/foo -DQUOTED="'${prefix}/share/doc'" +Cflags.private: -DFOO_STATIC diff --git a/tests/lib1/fragment-quoting-5.pc b/tests/lib1/fragment-quoting-5.pc new file mode 100644 index 0000000..22df0b3 --- /dev/null +++ b/tests/lib1/fragment-quoting-5.pc @@ -0,0 +1,10 @@ +prefix=/test +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: fragment-quoting-5 +Description: A testing pkg-config file +Version: 1.2.3 +Cflags: -fPIC -I${includedir}/foo -DQUOTED='${prefix}/share/doc' +Cflags.private: -DFOO_STATIC diff --git a/tests/lib1/fragment-quoting-6.pc b/tests/lib1/fragment-quoting-6.pc new file mode 100644 index 0000000..191acd9 --- /dev/null +++ b/tests/lib1/fragment-quoting-6.pc @@ -0,0 +1,10 @@ +prefix=/test +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include + +Name: fragment-quoting-6 +Description: A testing pkg-config file +Version: 1.2.3 +Cflags: -fPIC -I${includedir}/foo -DQUOTED=\'${prefix}/share/doc\' +Cflags.private: -DFOO_STATIC diff --git a/tests/parser.sh b/tests/parser.sh index 9f1fcdb..ed7bb9c 100755 --- a/tests/parser.sh +++ b/tests/parser.sh @@ -21,7 +21,10 @@ tests_init \ variable_whitespace \ fragment_quoting \ fragment_quoting_2 \ - fragment_quoting_3 + fragment_quoting_3 \ + fragment_quoting_4 \ + fragment_quoting_5 \ + fragment_quoting_6 comments_body() { @@ -179,3 +182,27 @@ fragment_quoting_3_body() -o inline:"-fPIC -I/test/include/foo -DQUOTED=\\\"/test/share/doc\\\" \n" \ pkgconf --cflags fragment-quoting-3 } + +fragment_quoting_4_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-fPIC -I/test/include/foo -DQUOTED=\"'/test/share/doc'\" \n" \ + pkgconf --cflags fragment-quoting-4 +} + +fragment_quoting_5_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-fPIC -I/test/include/foo -DQUOTED=/test/share/doc \n" \ + pkgconf --cflags fragment-quoting-5 +} + +fragment_quoting_6_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-fPIC -I/test/include/foo -DQUOTED=\\\'/test/share/doc\\\' \n" \ + pkgconf --cflags fragment-quoting-6 +}