summaryrefslogtreecommitdiff
path: root/check/check-print-options
blob: 198e5a1f8691a5668a469ea8a813ae0b693f0651 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#! /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="pcfiledir"
run_test --print-variables no-variables

RESULT="exec_prefix
includedir
libdir
pcfiledir
prefix"
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
broken Broken package - Module with broken .pc file"
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