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 +}