File: requires.sh

package info (click to toggle)
pkgconf 2.5.1-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 2,900 kB
  • sloc: ansic: 8,117; sh: 6,689; makefile: 247; python: 157
file content (176 lines) | stat: -rwxr-xr-x 3,703 bytes parent folder | download | duplicates (2)
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/usr/bin/env atf-sh

. $(atf_get_srcdir)/test_env.sh

tests_init \
	libs \
	libs_cflags \
	libs_static \
	libs_static_pure \
	cflags_libs_private \
	argv_parse2 \
	static_cflags \
	private_duplication \
	private_duplication_digraph \
	foo_bar \
	bar_foo \
	foo_metapackage_3 \
	libs_static2 \
	missing \
	requires_internal \
	requires_internal_missing \
	requires_internal_collision \
	orphaned_requires_private

libs_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-o inline:"-L/test/lib -lbar -lfoo\n" \
		pkgconf --libs bar
}

libs_cflags_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-o inline:"-fPIC -I/test/include/foo -L/test/lib -lbaz\n" \
		pkgconf --libs --cflags baz
}

libs_static_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-o inline:"-L/test/lib -lbaz -L/test/lib -lzee -lfoo\n" \
		pkgconf --static --libs baz
}

libs_static_pure_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-o inline:"-L/test/lib -lbaz -lfoo\n" \
		pkgconf --static --pure --libs baz
}

argv_parse2_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-o inline:"-llib-1 -pthread /test/lib/lib2.so\n" \
		pkgconf --static --libs argv-parse-2
}

static_cflags_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-o inline:"-fPIC -I/test/include/foo -DFOO_STATIC\n" \
		pkgconf --static --cflags baz
}

private_duplication_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-o inline:"-lprivate -lbaz -lzee -lbar -lfoo\n" \
		pkgconf --static --libs-only-l private-libs-duplication
}

private_duplication_digraph_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-o 'match:"user:request" -> "private-libs-duplication"' \
		-o 'match:"private-libs-duplication" -> "bar"' \
		-o 'match:"private-libs-duplication" -> "baz"' \
		-o 'match:"bar" -> "foo"' \
		-o 'match:"baz" -> "foo"' \
		pkgconf --static --libs-only-l private-libs-duplication --digraph
}

bar_foo_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-o inline:"-lbar -lfoo\n" \
		pkgconf --static --libs-only-l bar foo
}

foo_bar_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-o inline:"-lbar -lfoo\n" \
		pkgconf --static --libs-only-l foo bar
}

foo_metapackage_3_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-o inline:"-lbar -lfoo\n" \
		pkgconf --static --libs-only-l foo metapackage-3
}

libs_static2_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-o inline:"-lbar -lbar-private -L/test/lib -lfoo\n" \
		pkgconf --static --libs static-libs
}

missing_body()
{
	export PKG_CONFIG_PATH="${selfdir}/lib1"
	atf_check \
		-s exit:1 \
		-e ignore \
		-o ignore \
		pkgconf --cflags missing-require
}

requires_internal_body()
{
	atf_check \
		-o inline:"-lbar -lbar-private -L/test/lib -lfoo\n" \
		pkgconf --with-path="${selfdir}/lib1" --static --libs requires-internal
}

requires_internal_missing_body()
{
	atf_check \
		-s exit:1 \
		-e ignore \
		-o ignore \
		pkgconf --with-path="${selfdir}/lib1" --static --libs requires-internal-missing
}

requires_internal_collision_body()
{
	atf_check \
		-o inline:"-I/test/local/include/foo\n" \
		pkgconf --with-path="${selfdir}/lib1" --cflags requires-internal-collision
}

orphaned_requires_private_body()
{
	atf_check \
		-s exit:1 \
		-e ignore \
		-o ignore \
		pkgconf --with-path="${selfdir}/lib1" --cflags --libs orphaned-requires-private
}

cflags_libs_private_body()
{
	atf_check \
		-o inline:"\n" \
		pkgconf --with-path="${selfdir}/lib1" --libs cflags-libs-private-a

	atf_check \
		-o inline:"-lc\n" \
		pkgconf --with-path="${selfdir}/lib1" --static --libs cflags-libs-private-a
}