From c7e12356bc90d2956f86c8a6ed7f47c4109cd1fe Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Sat, 29 Sep 2012 09:57:46 -0700 Subject: [PATCH] check: Exercise all printing options Add tests for checking the output of various options that print information. For --list-all, a subdirectory with only two packages has been added so that its output doesn't change when more test packages are added to the check directory. --- check/Makefile.am | 7 +++++-- check/check-print-options | 32 ++++++++++++++++++++++++++++++++ check/sub/sub1.pc | 5 +++++ check/sub/sub2.pc | 5 +++++ 4 files changed, 47 insertions(+), 2 deletions(-) create mode 100755 check/check-print-options create mode 100644 check/sub/sub1.pc create mode 100644 check/sub/sub2.pc diff --git a/check/Makefile.am b/check/Makefile.am index 607d845..0f172f1 100644 --- a/check/Makefile.am +++ b/check/Makefile.am @@ -13,7 +13,8 @@ TESTS = \ check-idirafter \ check-whitespace \ check-cmd-options \ - check-version + check-version \ + check-print-options EXTRA_DIST = \ $(TESTS) \ @@ -28,4 +29,6 @@ EXTRA_DIST = \ idirafter.pc \ conflicts-test.pc \ whitespace.pc \ - fields-blank.pc + fields-blank.pc \ + sub/sub1.pc \ + sub/sub2.pc diff --git a/check/check-print-options b/check/check-print-options new file mode 100755 index 0000000..d23bc7a --- /dev/null +++ b/check/check-print-options @@ -0,0 +1,32 @@ +#! /bin/sh + +set -e +. ${srcdir}/common + +# --modversion +RESULT=1.0.0 +run_test --modversion simple + +# --print-variables +RESULT="exec_prefix +prefix +libdir +includedir" +run_test --print-variables simple + +# --print-provides +RESULT="simple = 1.0.0" +run_test --print-provides simple + +# --print-requires +RESULT="" +run_test --print-requires simple + +# --print-requires-private +RESULT="" +run_test --print-requires-private simple + +# --list-all, limit to a subdirectory +RESULT="sub1 Subdirectory package 1 - Test package 1 for subdirectory +sub2 Subdirectory package 2 - Test package 2 for subdirectory" +PKG_CONFIG_LIBDIR="$srcdir/sub" run_test --list-all diff --git a/check/sub/sub1.pc b/check/sub/sub1.pc new file mode 100644 index 0000000..beac16b --- /dev/null +++ b/check/sub/sub1.pc @@ -0,0 +1,5 @@ +Name: Subdirectory package 1 +Description: Test package 1 for subdirectory +Version: 1.0.0 +Libs: -L/sub/lib -lsub1 +Cflags: -I/sub/include diff --git a/check/sub/sub2.pc b/check/sub/sub2.pc new file mode 100644 index 0000000..6a31909 --- /dev/null +++ b/check/sub/sub2.pc @@ -0,0 +1,5 @@ +Name: Subdirectory package 2 +Description: Test package 2 for subdirectory +Version: 2.0.0 +Libs: -L/sub/lib -lsub2 +Cflags: -I/sub/include