From f5ce5fd75529fb304f8272c27568d09a046cb676 Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Wed, 29 Mar 2017 16:58:04 -0500 Subject: [PATCH] testsuite: add a parser test from Go (redhat #1437101) --- Makefile.am | 1 + tests/lib1/fragment-quoting-7.pc | 5 +++++ tests/parser.sh | 14 +++++++++++++- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 tests/lib1/fragment-quoting-7.pc diff --git a/Makefile.am b/Makefile.am index 48dd1f0..f45ce98 100644 --- a/Makefile.am +++ b/Makefile.am @@ -71,6 +71,7 @@ EXTRA_DIST = pkg.m4 \ tests/lib1/fragment-quoting-4.pc \ tests/lib1/fragment-quoting-5.pc \ tests/lib1/fragment-quoting-6.pc \ + tests/lib1/fragment-quoting-7.pc \ tests/test_env.sh \ $(test_scripts) \ doc/conf.py \ diff --git a/tests/lib1/fragment-quoting-7.pc b/tests/lib1/fragment-quoting-7.pc new file mode 100644 index 0000000..81bbfb2 --- /dev/null +++ b/tests/lib1/fragment-quoting-7.pc @@ -0,0 +1,5 @@ +Name: fragment-quoting-7 +Description: A testing pkg-config file, this time from Go +Version: 1.2.3 +Cflags: -Dhello=10 -Dworld=+32 -DDEFINED_FROM_PKG_CONFIG=hello\ world +Cflags.private: -DFOO_STATIC diff --git a/tests/parser.sh b/tests/parser.sh index a3a01c0..1d4f5be 100755 --- a/tests/parser.sh +++ b/tests/parser.sh @@ -24,7 +24,8 @@ tests_init \ fragment_quoting_3 \ fragment_quoting_4 \ fragment_quoting_5 \ - fragment_quoting_6 + fragment_quoting_6 \ + fragment_quoting_7 comments_body() { @@ -206,3 +207,14 @@ fragment_quoting_6_body() -o inline:"-fPIC -I/test/include/foo -DQUOTED=\\\'/test/share/doc\\\' \n" \ pkgconf --cflags fragment-quoting-6 } + +fragment_quoting_7_body() +{ + test_cflags=$(pkgconf --with-path=${selfdir}/lib1 --cflags fragment-quoting-7) + cat > test.c <<- __TESTCASE_END__ + int main(int argc, char *argv[]) { return DEFINED_FROM_PKG_CONFIG; } + __TESTCASE_END__ + cc -o test-fragment-quoting-7 ${test_cflags} ./test.c + atf_check -e 42 ./test-fragment-quoting-7 + rm -f test.c test-fragment-quoting-7 +}