aboutsummaryrefslogtreecommitdiff
path: root/testsuite/srcdir-tests.sh
blob: 325a30508ab2ff69d0ad28b0e2e12d28a1a4059e (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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
# tests for the get_srcdir() function

echo "============= get_srcdir() tests ================"

# FIXME: Note these following test cases only PASS if you have the source
# directories created already.
if test -d ${local_snapshots}/gcc.git; then
    in="git://git@git.linaro.org/toolchain/gcc.git"
    out="`get_srcdir $in | grep -v TRACE`"
    if test x"${out}" = x"${local_snapshots}/gcc.git"; then
	pass "get_srcdir: git repository"
    else
	fail "get_srcdir: git repository"
	fixme "get_srcdir returned ${out}"
    fi

    in="gcc.git"
    out="`get_srcdir $in | grep -v TRACE`"
    if test x"${out}" = x"${local_snapshots}/gcc.git"; then
	pass "get_srcdir: git repository no path"
    else
	fail "get_srcdir: git repository no path"
	fixme "get_srcdir returned ${out}"
    fi
else
    untested  "get_srcdir: git repository"
fi


if test -d ${local_snapshots}/gcc.git-linaro-4.8-branch; then
    in="gcc.git/linaro-4.8-branch"
    out="`get_srcdir $in | grep -v TRACE`"
    if test x"${out}" = x"${local_snapshots}/gcc.git-linaro-4.8-branch/gcc-4_8-branch"; then
	pass "get_srcdir: git repository with branch"
    else
	fail "get_srcdir: git repository with branch"
	fixme "get_srcdir returned ${out}"
    fi

    in="git://git@git.linaro.org/toolchain/gcc.git/linaro-4.8-branch"
    out="`get_srcdir $in | grep -v TRACE`"
    if test x"${out}" = x"${local_snapshots}/gcc.git-linaro-4.8-branch/gcc-4_8-branch"; then
	pass "get_srcdir: git repository URL with branch"
    else
	fail "get_srcdir: git repository URL with branch"
	fixme "get_srcdir returned ${out}"
    fi

else
    untested "get_srcdir: git repository with branch"
fi

if test -d ${local_snapshots}/gcc.git-linaro-4.8-branch@123456; then
    in="git://git@git.linaro.org/toolchain/gcc.git/linaro-4.8-branch@123456"
    out="`get_srcdir $in | grep -v TRACE`"
    if test x"${out}" = x"${local_snapshots}/gcc.git-linaro-4.8-branch@123456/gcc-4_8-branch"; then
	pass "get_srcdir: git repository with branch and commit"
    else
	fail "get_srcdir: git repository with branch and commit"
	fixme "get_srcdir returned ${out}"
    fi
else
    untested "get_srcdir: git repository with branch and commit"
fi

if test -d ${local_snapshots}/gcc-linaro-4.8-2013.06-1; then
    in="gcc-linaro-4.8-2013.06-1.tar.xz"
    out="`get_srcdir $in | grep -v TRACE`"
    if test x"${out}" = x"${local_snapshots}/gcc-linaro-4.8-2013.06-1"; then
	pass "get_srcdir: with tarball and full path"
    else
	fail "get_srcdir: with tarball and full path"
	fixme "get_srcdir returned ${out}"
    fi
else
    untested "get_srcdir: with tarball and full path"
fi

in="infrastructure/gmp-5.1.2.tar.xz"
out="`get_srcdir $in | grep -v TRACE`"
if test x"${out}" = x"${local_snapshots}/infrastructure/gmp-5.1.2"; then
    pass "get_srcdir: with tarball in subdirectory"
else
    fail "get_srcdir: with tarball in subdirectory"
    fixme "get_srcdir returned ${out}"
fi

if test -d ${local_snapshots}/gcc-linaro-4.7-2013.09; then
    in="gcc-linaro-4.7-2013.09.tar.bz2"
    out="`get_srcdir $in | grep -v TRACE`"
    if test x"${out}" = x"${local_snapshots}/gcc-linaro-4.7-2013.09"; then
	pass "get_srcdir: with tarball"
    else
	fail "get_srcdir: with tarball"
	fixme "get_srcdir returned ${out}"
    fi
else
    untested "get_srcdir: with tarball"
fi

echo "============= additional get_srcdir () tests ================"
# Some of these are redundant with those in srcdir_tests but since
# already have abe.git checked out we might as well test them here.
testing="get_srcdir: <repo>.git"
in="abe.git"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/abe.git"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi

testing="get_srcdir: <repo>.git@<revision>"
in="abe.git@12345"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/abe.git@12345"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi

testing="get_srcdir: <repo>.git/<branch>"
in="abe.git/branch"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/abe.git~branch"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi

testing="get_srcdir: <repo>.git/<branch>@<revision>"
in="abe.git/branch@12345"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/abe.git~branch@12345"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi

testing="get_srcdir: <repo>.git~<branch>@<revision>"
in="abe.git~branch@12345"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/abe.git~branch@12345"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi

testing="get_srcdir: <repo>.git/<multi/part/branch>@<revision>"
in="abe.git/multi/part/branch@12345"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/abe.git~multi-part-branch@12345"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi

testing="get_srcdir: <repo>.git~<multi/part/branch>@<revision>"
in="abe.git~multi/part/branch@12345"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/abe.git~multi-part-branch@12345"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi


# 
testing="get_srcdir: invalid identifier shouldn't return anything."
in="abe~multi/part/branch@12345"
out="`get_srcdir $in 2>/dev/null`"
if test x"${out}" = x""; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi

testing="get_srcdir: <repo>~<multi/part/branch>@<revision>"
in="git://git.linaro.org/people/rsavoye/abe~multi/part/branch@12345"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/abe~multi-part-branch@12345"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi

testing="get_srcdir: <repo>.git~<multi/part/branch>@<revision>"
in="abe.git~multi/part/branch@12345"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/abe.git~multi-part-branch@12345"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi

testing="get_srcdir: http://<user>@<url>/<repo>.git"
in="http://git@git.linaro.org/git/toolchain/abe.git"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/abe.git"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi

testing="get_srcdir: http://<user>@<url>/<repo>.git@<revision>"
in="http://git@git.linaro.org/git/toolchain/abe.git@12345"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/abe.git@12345"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi

testing="get_srcdir: eglibc special case"
in="eglibc.git~multi/part/branch@12345"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/eglibc.git~multi-part-branch@12345"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi

mkdir -p "${local_snapshots}/eglibc.git~multi-part-branch@12345/libc"
testing="get_srcdir: eglibc special case once /libc directory exists"
in="eglibc.git~multi/part/branch@12345"
out="`get_srcdir $in`"
if test x"${out}" = x"${local_snapshots}/eglibc.git~multi-part-branch@12345/libc"; then
    pass "${testing}"
else
    fail "${testing}"
    fixme "get_srcdir returned ${out}"
fi