summaryrefslogtreecommitdiff
path: root/check/check-print-options
diff options
context:
space:
mode:
Diffstat (limited to 'check/check-print-options')
-rwxr-xr-xcheck/check-print-options60
1 files changed, 60 insertions, 0 deletions
diff --git a/check/check-print-options b/check/check-print-options
new file mode 100755
index 0000000..a2a41e7
--- /dev/null
+++ b/check/check-print-options
@@ -0,0 +1,60 @@
+#! /bin/sh
+
+set -e
+. ${srcdir}/common
+
+# --version
+RESULT=$PACKAGE_VERSION
+run_test --version
+
+# --modversion
+RESULT=1.0.0
+run_test --modversion simple
+
+# --print-variables, make sure having no variables doesn't crash
+RESULT=""
+run_test --print-variables no-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="public-dep >= 1"
+run_test --print-requires requires-test
+
+# --print-requires-private
+RESULT="private-dep >= 1"
+run_test --print-requires-private requires-test
+
+# --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
+
+# Check handling when multiple incompatible options are set
+RESULT="Ignoring incompatible output option \"--modversion\"
+$PACKAGE_VERSION"
+run_test --version --modversion simple
+
+RESULT="Ignoring incompatible output option \"--version\"
+1.0.0"
+run_test --modversion --version simple
+
+# --print-requires/--print-requires-private allowed together
+RESULT="public-dep >= 1
+private-dep >= 1"
+run_test --print-requires --print-requires-private requires-test
+run_test --print-requires-private --print-requires requires-test
+
+# --exists and --atleast/exact/max-version can be mixed
+RESULT=""
+run_test --exists --atleast-version=1.0.0 simple
+run_test --exists --exact-version=1.0.0 simple
+run_test --exists --max-version=1.0.0 simple