summaryrefslogtreecommitdiff
path: root/check/check-dependencies
blob: 40472b5765cd1f6f23ca5eb0538ffc576c9c45dc (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
#! /bin/sh

# These tests check the evaluation of the 'recursive_fill_list' function to
# verify that for any package s that depends on t, that the library defined by
# package s occurs before that of package t

set -e

. ${srcdir}/common

export PKG_CONFIG_PATH
PKG_CONFIG_PATH="${srcdir}/dependencies"

# Shared dependency test.
RESULT="-la_dep_c -lb_dep_c -lc_dep"
run_test --libs a_dep_c b_dep_c
run_test --libs c_dep a_dep_c b_dep_c
run_test --libs a_dep_c c_dep b_dep_c
run_test --libs a_dep_c b_dep_c c_dep

# Redundancy test.
#
# Redundancy on the input line should not pass through.
RESULT="-la_dep_c -lb_dep_c -lc_dep"
run_test --libs a_dep_c a_dep_c b_dep_c
run_test --libs b_dep_c a_dep_c b_dep_c

# Diamond pattern test.
#
# One dependency of d depends on the other.
# Both dependencies of d depend on g
RESULT="-ld_dep_e_f -le_dep_g_f -lf_dep_g -lg_dep"
run_test --libs d_dep_e_f
RESULT="-ld_dep_f_e -le_dep_g_f -lf_dep_g -lg_dep"
run_test --libs d_dep_f_e

# Nested inclusion.
#
# Each package depends on all downsteam packages.
RESULT="-lh_dep_k_i_j -li_dep_k_j -lj_dep_k -lk_dep"
run_test --libs h_dep_k_i_j
run_test --libs h_dep_k_i_j i_dep_k_j
run_test --libs i_dep_k_j h_dep_k_i_j
run_test --libs k_dep j_dep_k i_dep_k_j h_dep_k_i_j