From 951a844c949ceb0f7f7986c9d1a15dde6f795cfa Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Fri, 30 Dec 2016 12:45:29 -0600 Subject: [PATCH] tests: add tests for the fragment mergeback changes --- Makefile.am | 2 ++ tests/lib1/flag-order-1.pc | 10 ++++++++++ tests/lib1/flag-order-3.pc | 10 ++++++++++ tests/parser.sh | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 tests/lib1/flag-order-1.pc create mode 100644 tests/lib1/flag-order-3.pc diff --git a/Makefile.am b/Makefile.am index fa390af..c81e69f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -60,6 +60,8 @@ EXTRA_DIST = pkg.m4 \ tests/lib1/cflags-whitespace-trailing.pc \ tests/lib1/provides.pc \ tests/lib1/provides-request-simple.pc \ + tests/lib1/flag-order-1.pc \ + tests/lib1/flag-order-3.pc \ tests/test_env.sh \ $(test_scripts) \ doc/conf.py \ diff --git a/tests/lib1/flag-order-1.pc b/tests/lib1/flag-order-1.pc new file mode 100644 index 0000000..d841751 --- /dev/null +++ b/tests/lib1/flag-order-1.pc @@ -0,0 +1,10 @@ +prefix=/test +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include +cflags=-I${includedir} + +Name: flag order 1 +Description: test for flag ordering +Version: 1 +Libs: -L${libdir} -Bdynamic -lfoo -Bstatic -lbar diff --git a/tests/lib1/flag-order-3.pc b/tests/lib1/flag-order-3.pc new file mode 100644 index 0000000..d813f50 --- /dev/null +++ b/tests/lib1/flag-order-3.pc @@ -0,0 +1,10 @@ +prefix=/test +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include +cflags=-I${includedir} + +Name: flag order 3 +Description: test for flag ordering +Version: 1 +Libs: -L${libdir} -Wl,--start-group -lfoo -lbar -Wl,--end-group diff --git a/tests/parser.sh b/tests/parser.sh index f718bc7..7e6bdda 100755 --- a/tests/parser.sh +++ b/tests/parser.sh @@ -13,6 +13,10 @@ tests_init \ tilde_quoting \ paren_quoting \ multiline_field \ + flag_order_1 \ + flag_order_2 \ + flag_order_3 \ + flag_order_4 \ quoted comments_body() @@ -107,3 +111,35 @@ quoted_body() -o inline:"-DQUOTED=\\\"bla\\\" \n" \ pkgconf --cflags quotes } + +flag_order_1_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/lib -Bdynamic -lfoo -Bstatic -lbar \n" \ + pkgconf --libs flag-order-1 +} + +flag_order_2_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/lib -Bdynamic -lfoo -Bstatic -lbar -lfoo \n" \ + pkgconf --libs flag-order-1 foo +} + +flag_order_3_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/lib -Wl,--start-group -lfoo -lbar -Wl,--end-group \n" \ + pkgconf --libs flag-order-3 +} + +flag_order_4_body() +{ + export PKG_CONFIG_PATH="${selfdir}/lib1" + atf_check \ + -o inline:"-L/test/lib -Wl,--start-group -lfoo -lbar -Wl,--end-group -lfoo \n" \ + pkgconf --libs flag-order-3 foo +}