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

set -e

. ${srcdir}/common

# --atleast-pkgconfig-version
RESULT=""
run_test --atleast-pkgconfig-version=$PACKAGE_VERSION

EXPECT_RETURN=1
RESULT=""
run_test --atleast-pkgconfig-version=999

v1=0.9.9
v2=1.0.0
v3=1.0.1

# exact version testing
EXPECT_RETURN=1
RESULT="Requested 'simple = $v1' but version of Simple test is $v2"
run_test --print-errors simple = $v1

EXPECT_RETURN=1
RESULT="Requested 'simple = $v1' but version of Simple test is $v2"
run_test --print-errors --exact-version=$v1 simple

EXPECT_RETURN=0
RESULT=""
run_test --print-errors simple = $v2

EXPECT_RETURN=0
RESULT=""
run_test --print-errors --exact-version=$v2 simple

EXPECT_RETURN=1
RESULT="Requested 'simple = $v3' but version of Simple test is $v2"
run_test --print-errors simple = $v3

EXPECT_RETURN=1
RESULT="Requested 'simple = $v3' but version of Simple test is $v2"
run_test --print-errors --exact-version=$v3 simple

# atleast version testing
EXPECT_RETURN=0
RESULT=""
run_test --print-errors simple \>= $v1

EXPECT_RETURN=0
RESULT=""
run_test --print-errors --atleast-version=$v1 simple

EXPECT_RETURN=0
RESULT=""
run_test --print-errors simple \>= $v2

EXPECT_RETURN=0
RESULT=""
run_test --print-errors --atleast-version=$v2 simple

EXPECT_RETURN=1
RESULT="Requested 'simple >= $v3' but version of Simple test is $v2"
run_test --print-errors simple \>= $v3

EXPECT_RETURN=1
RESULT="Requested 'simple >= $v3' but version of Simple test is $v2"
run_test --print-errors --atleast-version=$v3 simple

# max version testing
EXPECT_RETURN=1
RESULT="Requested 'simple <= $v1' but version of Simple test is $v2"
run_test --print-errors simple \<= $v1

EXPECT_RETURN=1
RESULT="Requested 'simple <= $v1' but version of Simple test is $v2"
run_test --print-errors --max-version=$v1 simple

EXPECT_RETURN=0
RESULT=""
run_test --print-errors simple \<= $v2

EXPECT_RETURN=0
RESULT=""
run_test --print-errors --max-version=$v2 simple

EXPECT_RETURN=0
RESULT=""
run_test --print-errors simple \<= $v3

EXPECT_RETURN=0
RESULT=""
run_test --print-errors --max-version=$v3 simple

# mixing version compare testing is not allowed
EXPECT_RETURN=0
RESULT='Ignoring incompatible output option "--exact-version"'
run_test --atleast-version=1.0.0 --exact-version=1.0.0 simple