diff options
Diffstat (limited to 'test/testing.sh')
-rwxr-xr-x | test/testing.sh | 698 |
1 files changed, 0 insertions, 698 deletions
diff --git a/test/testing.sh b/test/testing.sh deleted file mode 100755 index 0dd34bf1..00000000 --- a/test/testing.sh +++ /dev/null | |||
@@ -1,698 +0,0 @@ | |||
1 | #!/bin/bash -e | ||
2 | |||
3 | # Setup ######################################### | ||
4 | |||
5 | [ -e ../configure ] || { | ||
6 | echo "Please run this from the test/ directory." | ||
7 | exit 1 | ||
8 | } | ||
9 | |||
10 | if [ -z "$*" ] | ||
11 | then | ||
12 | ps aux | grep -q '[s]shd' || { | ||
13 | echo "Run sudo /bin/sshd in order to perform all tests." | ||
14 | exit 1 | ||
15 | } | ||
16 | fi | ||
17 | |||
18 | if [ "$1" == "--travis" ] | ||
19 | then | ||
20 | travis=true | ||
21 | shift | ||
22 | fi | ||
23 | |||
24 | luaversion=5.1.5 | ||
25 | |||
26 | if [ "$1" == "--lua" ] | ||
27 | then | ||
28 | shift | ||
29 | luaversion=$1 | ||
30 | shift | ||
31 | fi | ||
32 | |||
33 | is_jit=`[ "${luaversion::3}" = "jit" ] && echo 1 || echo 0` | ||
34 | |||
35 | if [ "$is_jit" = 1 ] | ||
36 | then | ||
37 | luashortversion=5.1 | ||
38 | luajitversion=${luaversion:4} | ||
39 | else | ||
40 | luashortversion=`echo $luaversion | cut -d. -f 1-2` | ||
41 | fi | ||
42 | |||
43 | testing_dir="$PWD" | ||
44 | |||
45 | testing_lrprefix="$testing_dir/testing_lrprefix-$luaversion" | ||
46 | testing_tree="$testing_dir/testing-$luaversion" | ||
47 | testing_sys_tree="$testing_dir/testing_sys-$luaversion" | ||
48 | testing_tree_copy="$testing_dir/testing_copy-$luaversion" | ||
49 | testing_sys_tree_copy="$testing_dir/testing_sys_copy-$luaversion" | ||
50 | testing_cache="$testing_dir/testing_cache-$luaversion" | ||
51 | testing_server="$testing_dir/testing_server-$luaversion" | ||
52 | |||
53 | if [ "$1" == "--clean" ] | ||
54 | then | ||
55 | shift | ||
56 | rm -rf "$testing_cache" | ||
57 | rm -rf "$testing_server" | ||
58 | fi | ||
59 | |||
60 | [ "$1" ] || rm -f luacov.stats.out | ||
61 | rm -f luacov.report.out | ||
62 | rm -rf /tmp/luarocks_testing | ||
63 | mkdir /tmp/luarocks_testing | ||
64 | rm -rf "$testing_lrprefix" | ||
65 | rm -rf "$testing_tree" | ||
66 | rm -rf "$testing_sys_tree" | ||
67 | rm -rf "$testing_tree_copy" | ||
68 | rm -rf "$testing_sys_tree_copy" | ||
69 | rm -rf "$testing_dir/testing_config.lua" | ||
70 | rm -rf "$testing_dir/testing_config_show_downloads.lua" | ||
71 | rm -rf "$testing_dir/testing_config_sftp.lua" | ||
72 | rm -rf "$testing_dir/luacov.config" | ||
73 | |||
74 | mkdir -p "$testing_cache" | ||
75 | |||
76 | [ "$1" = "clean" ] && { | ||
77 | rm -f luacov.stats.out | ||
78 | exit 0 | ||
79 | } | ||
80 | |||
81 | cat <<EOF > $testing_dir/testing_config.lua | ||
82 | rocks_trees = { | ||
83 | "$testing_tree", | ||
84 | { name = "system", root = "$testing_sys_tree" }, | ||
85 | } | ||
86 | rocks_servers = { | ||
87 | "$testing_server" | ||
88 | } | ||
89 | local_cache = "$testing_cache" | ||
90 | upload_server = "testing" | ||
91 | upload_user = "$USER" | ||
92 | upload_servers = { | ||
93 | testing = { | ||
94 | rsync = "localhost/tmp/luarocks_testing", | ||
95 | }, | ||
96 | } | ||
97 | external_deps_dirs = { | ||
98 | "/usr/local", | ||
99 | "/usr", | ||
100 | -- These are used for a test that fails, so it | ||
101 | -- can point to invalid paths: | ||
102 | { | ||
103 | prefix = "/opt", | ||
104 | bin = "bin", | ||
105 | include = "include", | ||
106 | lib = { "lib", "lib64" }, | ||
107 | } | ||
108 | } | ||
109 | EOF | ||
110 | ( | ||
111 | cat $testing_dir/testing_config.lua | ||
112 | echo "show_downloads = true" | ||
113 | ) > $testing_dir/testing_config_show_downloads.lua | ||
114 | cat <<EOF > $testing_dir/testing_config_sftp.lua | ||
115 | rocks_trees = { | ||
116 | "$testing_tree", | ||
117 | "$testing_sys_tree", | ||
118 | } | ||
119 | local_cache = "$testing_cache" | ||
120 | upload_server = "testing" | ||
121 | upload_user = "$USER" | ||
122 | upload_servers = { | ||
123 | testing = { | ||
124 | sftp = "localhost/tmp/luarocks_testing", | ||
125 | }, | ||
126 | } | ||
127 | EOF | ||
128 | cat <<EOF > $testing_dir/luacov.config | ||
129 | return { | ||
130 | statsfile = "$testing_dir/luacov.stats.out", | ||
131 | reportfile = "$testing_dir/luacov.report.out", | ||
132 | modules = { | ||
133 | ["luarocks"] = "src/bin/luarocks", | ||
134 | ["luarocks-admin"] = "src/bin/luarocks-admin", | ||
135 | ["luarocks.*"] = "src", | ||
136 | ["luarocks.*.*"] = "src", | ||
137 | ["luarocks.*.*.*"] = "src" | ||
138 | } | ||
139 | } | ||
140 | EOF | ||
141 | |||
142 | export LUAROCKS_CONFIG="$testing_dir/testing_config.lua" | ||
143 | export LUA_PATH= | ||
144 | export LUA_CPATH= | ||
145 | |||
146 | if [ "$travis" ] | ||
147 | then | ||
148 | luadir=/tmp/lua-$luaversion | ||
149 | pushd /tmp | ||
150 | if [ ! -e "$luadir/bin/lua" ] | ||
151 | then | ||
152 | mkdir -p lua | ||
153 | cd lua | ||
154 | if [ "$is_jit" = 1 ] | ||
155 | then | ||
156 | echo "Downloading LuaJIT $luajitversion..." | ||
157 | #rm -f "LuaJIT-$luajitversion.tar.gz" | ||
158 | wget -c "https://github.com/LuaJIT/LuaJIT/archive/v$luajitversion.tar.gz" &> /dev/null | ||
159 | tar zxpf "v$luajitversion.tar.gz" | ||
160 | cd "LuaJIT-$luajitversion" | ||
161 | echo "Building LuaJIT $luajitversion..." | ||
162 | make PREFIX="$luadir" &> /dev/null | ||
163 | make install PREFIX="$luadir" &> /dev/null | ||
164 | else | ||
165 | echo "Downloading Lua $luaversion..." | ||
166 | #rm -f "lua-$luaversion.tar.gz" | ||
167 | wget -c "http://www.lua.org/ftp/lua-$luaversion.tar.gz" &> /dev/null | ||
168 | tar zxpf "lua-$luaversion.tar.gz" | ||
169 | cd "lua-$luaversion" | ||
170 | echo "Building Lua $luaversion..." | ||
171 | make linux INSTALL_TOP="$luadir" &> /dev/null | ||
172 | make install INSTALL_TOP="$luadir" &> /dev/null | ||
173 | fi | ||
174 | fi | ||
175 | popd | ||
176 | [ -e ~/.ssh/id_rsa.pub ] || ssh-keygen -t rsa -P "" -f ~/.ssh/id_rsa | ||
177 | cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys | ||
178 | chmod og-wx ~/.ssh/authorized_keys | ||
179 | ssh-keyscan localhost >> ~/.ssh/known_hosts | ||
180 | else | ||
181 | if [ "$is_jit" = 1 ] | ||
182 | then | ||
183 | luadir="/Programs/LuaJIT/$luajitversion" | ||
184 | echo HELLO $luadir | ||
185 | else | ||
186 | luadir="/Programs/Lua/$luaversion" | ||
187 | fi | ||
188 | if [ ! -e "$luadir" ] | ||
189 | then | ||
190 | luadir="/usr/local" | ||
191 | fi | ||
192 | fi | ||
193 | |||
194 | if [ `uname -m` = i686 ] | ||
195 | then | ||
196 | platform="linux-x86" | ||
197 | else | ||
198 | platform="linux-x86_64" | ||
199 | fi | ||
200 | |||
201 | if [ "$is_jit" = 1 ] | ||
202 | then | ||
203 | lua="$luadir/bin/luajit" | ||
204 | luarocks_configure_extra_args="--lua-suffix=jit --with-lua-include=$luadir/include/luajit-2.0" | ||
205 | else | ||
206 | lua="$luadir/bin/lua" | ||
207 | fi | ||
208 | |||
209 | version_luasocket=3.0rc1 | ||
210 | verrev_luasocket=${version_luasocket}-1 | ||
211 | srcdir_luasocket=luasocket-3.0-rc1 | ||
212 | |||
213 | version_cprint=0.1 | ||
214 | verrev_cprint=0.1-2 | ||
215 | |||
216 | new_version_say=1.2-1 | ||
217 | old_version_say=1.0-1 | ||
218 | |||
219 | version_luacov=0.11.0 | ||
220 | verrev_luacov=${version_luacov}-1 | ||
221 | version_lxsh=0.8.6 | ||
222 | version_validate_args=1.5.4 | ||
223 | verrev_validate_args=1.5.4-1 | ||
224 | verrev_lxsh=${version_lxsh}-2 | ||
225 | version_abelhas=1.0 | ||
226 | verrev_abelhas=${version_abelhas}-1 | ||
227 | |||
228 | luasec=luasec | ||
229 | |||
230 | cd .. | ||
231 | ./configure --with-lua="$luadir" --prefix="$testing_lrprefix" $luarocks_configure_extra_args | ||
232 | make clean | ||
233 | make src/luarocks/site_config.lua | ||
234 | make dev | ||
235 | cd src | ||
236 | basedir=$PWD | ||
237 | run_lua() { | ||
238 | if [ "$1" = "--noecho" ]; then shift; noecho=1; else noecho=0; fi | ||
239 | if [ "$1" = "--nocov" ]; then shift; nocov=1; else nocov=0; fi | ||
240 | if [ "$noecho" = 0 ] | ||
241 | then | ||
242 | echo $* | ||
243 | fi | ||
244 | cmd=$1 | ||
245 | shift | ||
246 | if [ "$nocov" = 0 ] | ||
247 | then | ||
248 | "$lua" -e"require('luacov.runner')('$testing_dir/luacov.config')" "$basedir/bin/$cmd" "$@" | ||
249 | else | ||
250 | "$lua" "$basedir/bin/$cmd" "$@" | ||
251 | fi | ||
252 | } | ||
253 | luarocks="run_lua luarocks" | ||
254 | luarocks_nocov="run_lua --nocov luarocks" | ||
255 | luarocks_noecho="run_lua --noecho luarocks" | ||
256 | luarocks_noecho_nocov="run_lua --noecho --nocov luarocks" | ||
257 | luarocks_admin="run_lua luarocks-admin" | ||
258 | luarocks_admin_nocov="run_lua --nocov luarocks-admin" | ||
259 | luajit_luarocks="luajit -e require('luacov.runner')('$testing_dir/luacov.config') $basedir/bin/luarocks" | ||
260 | |||
261 | ################################################### | ||
262 | |||
263 | mkdir -p "$testing_server" | ||
264 | ( | ||
265 | cd "$testing_server" | ||
266 | luarocks_repo="https://luarocks.org" | ||
267 | get() { [ -e `basename "$1"` ] || wget -c "$1"; } | ||
268 | get "$luarocks_repo/luacov-${verrev_luacov}.src.rock" | ||
269 | get "$luarocks_repo/luacov-${verrev_luacov}.rockspec" | ||
270 | get "$luarocks_repo/luadoc-3.0.1-1.src.rock" | ||
271 | get "$luarocks_repo/lualogging-1.3.0-1.src.rock" | ||
272 | get "$luarocks_repo/luasocket-${verrev_luasocket}.src.rock" | ||
273 | get "$luarocks_repo/luasocket-${verrev_luasocket}.rockspec" | ||
274 | get "$luarocks_repo/luafilesystem-1.6.3-1.src.rock" | ||
275 | get "$luarocks_repo/stdlib-41.0.0-1.src.rock" | ||
276 | get "$luarocks_repo/luarepl-0.4-1.src.rock" | ||
277 | get "$luarocks_repo/validate-args-1.5.4-1.rockspec" | ||
278 | get "$luarocks_repo/luasec-0.6-1.rockspec" | ||
279 | get "$luarocks_repo/luabitop-1.0.2-1.rockspec" | ||
280 | get "$luarocks_repo/luabitop-1.0.2-1.src.rock" | ||
281 | get "$luarocks_repo/lpty-1.0.1-1.src.rock" | ||
282 | get "$luarocks_repo/cprint-${verrev_cprint}.src.rock" | ||
283 | get "$luarocks_repo/cprint-${verrev_cprint}.rockspec" | ||
284 | get "$luarocks_repo/wsapi-1.6-1.src.rock" | ||
285 | get "$luarocks_repo/lxsh-${verrev_lxsh}.src.rock" | ||
286 | get "$luarocks_repo/lxsh-${verrev_lxsh}.rockspec" | ||
287 | get "$luarocks_repo/abelhas-${verrev_abelhas}.rockspec" | ||
288 | get "$luarocks_repo/lzlib-0.4.1.53-1.src.rock" | ||
289 | get "$luarocks_repo/lpeg-0.12-1.src.rock" | ||
290 | get "$luarocks_repo/luaposix-33.2.1-1.src.rock" | ||
291 | get "$luarocks_repo/md5-1.2-1.src.rock" | ||
292 | get "$luarocks_repo/lmathx-20120430.51-1.src.rock" | ||
293 | get "$luarocks_repo/lmathx-20120430.51-1.rockspec" | ||
294 | get "$luarocks_repo/lmathx-20120430.52-1.src.rock" | ||
295 | get "$luarocks_repo/lmathx-20120430.52-1.rockspec" | ||
296 | get "$luarocks_repo/lmathx-20150505-1.src.rock" | ||
297 | get "$luarocks_repo/lmathx-20150505-1.rockspec" | ||
298 | get "$luarocks_repo/lua-path-0.2.3-1.src.rock" | ||
299 | get "$luarocks_repo/lua-cjson-2.1.0-1.src.rock" | ||
300 | get "$luarocks_repo/luacov-coveralls-0.1.1-1.src.rock" | ||
301 | get "$luarocks_repo/say-1.2-1.src.rock" | ||
302 | get "$luarocks_repo/say-1.0-1.src.rock" | ||
303 | get "$luarocks_repo/luassert-1.7.0-1.src.rock" | ||
304 | ) | ||
305 | $luarocks_admin_nocov make_manifest "$testing_server" | ||
306 | |||
307 | ################################################### | ||
308 | |||
309 | checksum_path() { | ||
310 | ( cd "$1"; find . -printf "%s %p\n" | md5sum ) | ||
311 | } | ||
312 | |||
313 | build_environment() { | ||
314 | rm -rf "$testing_tree" | ||
315 | rm -rf "$testing_sys_tree" | ||
316 | rm -rf "$testing_tree_copy" | ||
317 | rm -rf "$testing_sys_tree_copy" | ||
318 | mkdir -p "$testing_tree" | ||
319 | mkdir -p "$testing_sys_tree" | ||
320 | $luarocks_admin_nocov make_manifest "$testing_cache" | ||
321 | for package in "$@" | ||
322 | do | ||
323 | $luarocks_nocov install --only-server="$testing_cache" --tree="$testing_sys_tree" $package || { | ||
324 | $luarocks_nocov build --tree="$testing_sys_tree" $package | ||
325 | $luarocks_nocov pack --tree="$testing_sys_tree" $package; mv $package-*.rock "$testing_cache" | ||
326 | } | ||
327 | done | ||
328 | export LUA_PATH= | ||
329 | export LUA_CPATH= | ||
330 | eval `$luarocks_noecho_nocov path --bin` | ||
331 | cp -a "$testing_tree" "$testing_tree_copy" | ||
332 | cp -a "$testing_sys_tree" "$testing_sys_tree_copy" | ||
333 | testing_tree_copy_md5=`checksum_path "$testing_tree_copy"` | ||
334 | testing_sys_tree_copy_md5=`checksum_path "$testing_sys_tree_copy"` | ||
335 | } | ||
336 | |||
337 | reset_environment() { | ||
338 | testing_tree_md5=`checksum_path "$testing_tree"` | ||
339 | testing_sys_tree_md5=`checksum_path "$testing_sys_tree"` | ||
340 | if [ "$testing_tree_md5" != "$testing_tree_copy_md5" ] | ||
341 | then | ||
342 | rm -rf "$testing_tree" | ||
343 | cp -a "$testing_tree_copy" "$testing_tree" | ||
344 | fi | ||
345 | if [ "$testing_sys_tree_md5" != "$testing_sys_tree_copy_md5" ] | ||
346 | then | ||
347 | rm -rf "$testing_sys_tree" | ||
348 | cp -a "$testing_sys_tree_copy" "$testing_sys_tree" | ||
349 | fi | ||
350 | } | ||
351 | |||
352 | need() { | ||
353 | echo "Obtaining $1 $2..." | ||
354 | if $luarocks show $1 &> /dev/null | ||
355 | then | ||
356 | echo "Already available" | ||
357 | return | ||
358 | fi | ||
359 | platrock="$1-$2.$platform.rock" | ||
360 | if [ ! -e "$testing_cache/$platrock" ] | ||
361 | then | ||
362 | echo "Building $1 $2..." | ||
363 | $luarocks_nocov build --pack-binary-rock $1 $2 | ||
364 | mv "$platrock" "$testing_cache" | ||
365 | fi | ||
366 | echo "Installing $1 $2..." | ||
367 | $luarocks_nocov install "$testing_cache/$platrock" | ||
368 | return | ||
369 | } | ||
370 | need_luasocket() { need luasocket $verrev_luasocket; } | ||
371 | |||
372 | # Tests ######################################### | ||
373 | test_version() { $luarocks --version; } | ||
374 | |||
375 | fail_unknown_command() { $luarocks unknown_command; } | ||
376 | |||
377 | fail_arg_boolean_parameter() { $luarocks --porcelain=invalid; } | ||
378 | fail_arg_boolean_unknown() { $luarocks --invalid-flag; } | ||
379 | fail_arg_string_no_parameter() { $luarocks --server; } | ||
380 | fail_arg_string_followed_by_flag() { $luarocks --server --porcelain; } | ||
381 | fail_arg_string_unknown() { $luarocks --invalid-flag=abc; } | ||
382 | |||
383 | fail_invalid_assignment() { $luarocks invalid=5; } | ||
384 | |||
385 | test_empty_list() { $luarocks list; } | ||
386 | test_list_outdated() { $luarocks list --outdated; } | ||
387 | |||
388 | fail_sysconfig_err() { local err=0; local scdir="$testing_lrprefix/etc/luarocks/"; mkdir -p "$scdir"; local sysconfig="$scdir/config.lua"; echo "aoeui" > "$sysconfig"; echo $sysconfig; $luarocks list; err=$?; rm "$sysconfig"; return "$err"; } | ||
389 | fail_sysconfig_default_err() { local err=0; local scdir="$testing_lrprefix/etc/luarocks/"; mkdir -p "$scdir"; local sysconfig="$scdir/config-$luashortversion.lua"; echo "aoeui" > "$sysconfig"; echo $sysconfig; $luarocks list; err=$?; rm "$sysconfig"; return "$err"; } | ||
390 | |||
391 | fail_build_noarg() { $luarocks build; } | ||
392 | fail_download_noarg() { $luarocks download; } | ||
393 | fail_install_noarg() { $luarocks install; } | ||
394 | fail_lint_noarg() { $luarocks lint; } | ||
395 | fail_search_noarg() { $luarocks search; } | ||
396 | fail_show_noarg() { $luarocks show; } | ||
397 | fail_unpack_noarg() { $luarocks unpack; } | ||
398 | fail_upload_noarg() { $luarocks upload; } | ||
399 | fail_remove_noarg() { $luarocks remove; } | ||
400 | fail_doc_noarg() { $luarocks doc; } | ||
401 | |||
402 | fail_build_invalid() { $luarocks build invalid; } | ||
403 | fail_download_invalid() { $luarocks download invalid; } | ||
404 | fail_install_invalid() { $luarocks install invalid; } | ||
405 | fail_lint_invalid() { $luarocks lint invalid; } | ||
406 | fail_show_invalid() { $luarocks show invalid; } | ||
407 | fail_new_version_invalid() { $luarocks new_version invalid; } | ||
408 | |||
409 | test_list_invalidtree() { $luarocks --tree=/some/invalid/tree list; } | ||
410 | |||
411 | fail_inexistent_dir() { mkdir idontexist; cd idontexist; rmdir ../idontexist; $luarocks; err=$?; cd ..; return $err; } | ||
412 | |||
413 | fail_make_norockspec() { $luarocks make; } | ||
414 | |||
415 | fail_build_permissions() { $luarocks build --tree=/usr lpeg; } | ||
416 | fail_build_permissions_parent() { $luarocks build --tree=/usr/invalid lpeg; } | ||
417 | |||
418 | test_build_verbose() { $luarocks build --verbose lpeg; } | ||
419 | test_build_timeout() { $luarocks --timeout=10; } | ||
420 | fail_build_timeout_invalid() { $luarocks --timeout=abc; } | ||
421 | test_build_branch() { $luarocks build --branch=master lpeg; } | ||
422 | fail_build_invalid_entry_deps_mode() { $luarocks build --deps-mode=123 lpeg; } | ||
423 | test_build_only_server() { $luarocks --only-server=testing; } | ||
424 | test_build_only_sources() { $luarocks build --only-sources="http://example.com" lpeg; } | ||
425 | fail_build_blank_arg() { $luarocks build --tree="" lpeg; } | ||
426 | test_build_withpatch() { need_luasocket; $luarocks build luadoc; } | ||
427 | test_build_diffversion() { $luarocks build luacov ${version_luacov}; } | ||
428 | test_build_command() { $luarocks build stdlib; } | ||
429 | test_build_install_bin() { $luarocks build luarepl; } | ||
430 | test_build_nohttps() { need_luasocket; $luarocks download --rockspec validate-args ${verrev_validate_args} && $luarocks build ./validate-args-${version_validate_args}-1.rockspec && rm ./validate-args-${version_validate_args}-1.rockspec; } | ||
431 | test_build_https() { need_luasocket; $luarocks download --rockspec validate-args ${verrev_validate_args} && $luarocks install $luasec && $luarocks build ./validate-args-${verrev_validate_args}.rockspec && rm ./validate-args-${verrev_validate_args}.rockspec; } | ||
432 | test_build_supported_platforms() { $luarocks build lpty; } | ||
433 | test_build_only_deps_rockspec() { $luarocks download --rockspec lxsh ${verrev_lxsh} && $luarocks build ./lxsh-${verrev_lxsh}.rockspec --only-deps && { $luarocks show lxsh; [ $? -ne 0 ]; }; } | ||
434 | test_build_only_deps_src_rock() { $luarocks download --source lxsh ${verrev_lxsh} && $luarocks build ./lxsh-${verrev_lxsh}.src.rock --only-deps && { $luarocks show lxsh; [ $? -ne 0 ]; }; } | ||
435 | test_build_only_deps() { $luarocks build luasec --only-deps && { $luarocks show luasec; [ $? -ne 0 ]; }; } | ||
436 | test_install_only_deps() { $luarocks install lxsh ${verrev_lxsh} --only-deps && { $luarocks show lxsh; [ $? -ne 0 ]; }; } | ||
437 | test_build_no_deps() { $luarocks build luasec --nodeps; } | ||
438 | test_install_no_deps() { $luarocks install luasec --nodeps; } | ||
439 | fail_build_missing_external() { $luarocks build "$testing_dir/testfiles/missing_external-0.1-1.rockspec" INEXISTENT_INCDIR="/invalid/dir"; } | ||
440 | fail_build_invalidpatch() { need_luasocket; $luarocks build "$testing_dir/testfiles/invalid_patch-0.1-1.rockspec"; } | ||
441 | |||
442 | test_build_deps_partial_match() { $luarocks build lmathx; } | ||
443 | test_build_show_downloads() { export LUAROCKS_CONFIG="$testing_dir/testing_config_show_downloads.lua" && $luarocks build alien; export LUAROCKS_CONFIG="$testing_dir/testing_config.lua"; } | ||
444 | |||
445 | test_download_all() { $luarocks download --all validate-args && rm validate-args-*; } | ||
446 | test_download_rockspecversion() { $luarocks download --rockspec validate-args ${verrev_validate_args} && rm validate-args-*; } | ||
447 | |||
448 | test_help() { $luarocks help; } | ||
449 | fail_help_invalid() { $luarocks help invalid; } | ||
450 | |||
451 | test_install_only_deps() { $luarocks install --only-deps "$testing_cache/luasocket-$verrev_luasocket.$platform.rock"; } | ||
452 | test_install_binaryrock() { $luarocks build --pack-binary-rock cprint && $luarocks install ./cprint-${verrev_cprint}.${platform}.rock && rm ./cprint-${verrev_cprint}.${platform}.rock; } | ||
453 | test_install_with_bin() { $luarocks install wsapi; } | ||
454 | fail_install_notazipfile() { $luarocks install "$testing_dir/testfiles/not_a_zipfile-1.0-1.src.rock"; } | ||
455 | fail_install_invalidpatch() { need_luasocket; $luarocks install "$testing_dir/testfiles/invalid_patch-0.1-1.rockspec"; } | ||
456 | fail_install_invalid_filename() { $luarocks install "invalid.rock"; } | ||
457 | fail_install_invalid_arch() { $luarocks install "foo-1.0-1.impossible-x86.rock"; } | ||
458 | test_install_reinstall() { $luarocks install "$testing_cache/luasocket-$verrev_luasocket.$platform.rock"; $luarocks install --deps-mode=none "$testing_cache/luasocket-$verrev_luasocket.$platform.rock"; } | ||
459 | |||
460 | fail_local_root() { USER=root $luarocks install --local luasocket; } | ||
461 | |||
462 | test_site_config() { mv ../src/luarocks/site_config.lua ../src/luarocks/site_config.lua.tmp; $luarocks; mv ../src/luarocks/site_config.lua.tmp ../src/luarocks/site_config.lua; } | ||
463 | |||
464 | test_lint_ok() { $luarocks download --rockspec validate-args ${verrev_validate_args} && $luarocks lint ./validate-args-${verrev_validate_args}.rockspec && rm ./validate-args-${verrev_validate_args}.rockspec; } | ||
465 | fail_lint_type_mismatch_string() { $luarocks lint "$testing_dir/testfiles/type_mismatch_string-1.0-1.rockspec"; } | ||
466 | fail_lint_type_mismatch_version() { $luarocks lint "$testing_dir/testfiles/type_mismatch_version-1.0-1.rockspec"; } | ||
467 | fail_lint_type_mismatch_table() { $luarocks lint "$testing_dir/testfiles/type_mismatch_table-1.0-1.rockspec"; } | ||
468 | fail_lint_no_build_table() { $luarocks lint "$testing_dir/testfiles/no_build_table-0.1-1.rockspec"; } | ||
469 | |||
470 | test_list() { $luarocks list; } | ||
471 | test_list_porcelain() { $luarocks list --porcelain; } | ||
472 | |||
473 | test_make_with_rockspec() { rm -rf ./luasocket-${verrev_luasocket} && $luarocks download --source luasocket && $luarocks unpack ./luasocket-${verrev_luasocket}.src.rock && cd luasocket-${verrev_luasocket}/${srcdir_luasocket} && $luarocks make luasocket-${verrev_luasocket}.rockspec && cd ../.. && rm -rf ./luasocket-${verrev_luasocket}; } | ||
474 | test_make_default_rockspec() { rm -rf ./lxsh-${verrev_lxsh} && $luarocks download --source lxsh ${verrev_lxsh} && $luarocks unpack ./lxsh-${verrev_lxsh}.src.rock && cd lxsh-${verrev_lxsh}/lxsh-${version_lxsh}-1 && $luarocks new_version lxsh-${verrev_lxsh}.rockspec && $luarocks make && cd ../.. && rm -rf ./lxsh-${verrev_lxsh}; } | ||
475 | test_make_unnamed_rockspec() { rm -rf ./lxsh-${verrev_lxsh} && $luarocks download --source lxsh ${verrev_lxsh} && $luarocks unpack ./lxsh-${verrev_lxsh}.src.rock && cd lxsh-${verrev_lxsh}/lxsh-${version_lxsh}-1 && cp lxsh-${verrev_lxsh}.rockspec rockspec && $luarocks make && cd ../.. && rm -rf ./lxsh-${verrev_lxsh}; } | ||
476 | fail_make_ambiguous_rockspec() { rm -rf ./lxsh-${verrev_lxsh} && $luarocks download --source lxsh ${verrev_lxsh} && $luarocks unpack ./lxsh-${verrev_lxsh}.src.rock && cd lxsh-${verrev_lxsh}/lxsh-${version_lxsh}-1 && cp lxsh-${verrev_lxsh}.rockspec lxsh2-${verrev_lxsh}.rockspec && $luarocks make && cd ../.. && rm -rf ./lxsh-${verrev_lxsh}; } | ||
477 | fail_make_ambiguous_unnamed_rockspec() { rm -rf ./lxsh-${verrev_lxsh} && $luarocks download --source lxsh ${verrev_lxsh} && $luarocks unpack ./lxsh-${verrev_lxsh}.src.rock && cd lxsh-${verrev_lxsh}/lxsh-${version_lxsh}-1 && mv lxsh-${verrev_lxsh}.rockspec 1_rockspec && cp 1_rockspec 2_rockspec && $luarocks make && cd ../.. && rm -rf ./lxsh-${verrev_lxsh}; } | ||
478 | test_make_pack_binary_rock() { rm -rf ./lxsh-${verrev_lxsh} && $luarocks download --source lxsh ${verrev_lxsh} && $luarocks unpack ./lxsh-${verrev_lxsh}.src.rock && cd lxsh-${verrev_lxsh}/lxsh-${version_lxsh}-1 && $luarocks make --deps-mode=none --pack-binary-rock && [ -e ./lxsh-${verrev_lxsh}.all.rock ] && cd ../.. && rm -rf ./lxsh-${verrev_lxsh}; } | ||
479 | |||
480 | test_new_version() { $luarocks download --rockspec luacov ${version_luacov} && $luarocks new_version ./luacov-${version_luacov}-1.rockspec 0.2 && rm ./luacov-0.*; } | ||
481 | test_new_version_url() { $luarocks download --rockspec abelhas 1.0 && $luarocks new_version ./abelhas-1.0-1.rockspec 1.1 https://github.com/downloads/ittner/abelhas/abelhas-1.1.tar.gz && rm ./abelhas-*; } | ||
482 | test_new_version_tag() { $luarocks download --rockspec luacov ${version_luacov} && $luarocks new_version ./luacov-${version_luacov}-1.rockspec --tag v0.3 && rm ./luacov-0.3-1.rockspec; } | ||
483 | test_new_version_tag_without_arg() { rm -rf ./*rockspec && $luarocks download --rockspec luacov ${version_luacov} && $luarocks new_version --tag v0.3 && rm ./luacov-0.3-1.rockspec; } | ||
484 | |||
485 | test_pack() { $luarocks list && $luarocks pack luacov && rm ./luacov-*.rock; } | ||
486 | test_pack_src() { $luarocks install $luasec && $luarocks download --rockspec luasocket && $luarocks pack ./luasocket-${verrev_luasocket}.rockspec && rm ./luasocket-${version_luasocket}-*.rock; } | ||
487 | |||
488 | test_path() { $luarocks path --bin; } | ||
489 | test_path_lr_path() { $luarocks path --lr-path; } | ||
490 | test_path_lr_cpath() { $luarocks path --lr-cpath; } | ||
491 | test_path_lr_bin() { $luarocks path --lr-bin; } | ||
492 | test_path_with_tree() { $luarocks path --tree=lua_modules; } | ||
493 | |||
494 | fail_purge_missing_tree() { $luarocks purge --tree="$testing_tree"; } | ||
495 | fail_purge_tree_notstring() { $luarocks purge --tree=1; } | ||
496 | test_purge() { $luarocks purge --tree="$testing_sys_tree"; } | ||
497 | test_purge_oldversions() { $luarocks purge --old-versions --tree="$testing_sys_tree"; } | ||
498 | |||
499 | test_remove() { $luarocks build abelhas ${version_abelhas} && $luarocks remove abelhas ${version_abelhas}; } | ||
500 | test_remove_force() { need_luasocket; $luarocks build lualogging && $luarocks remove --force luasocket; } | ||
501 | test_remove_force_fast() { need_luasocket; $luarocks build lualogging && $luarocks remove --force-fast luasocket; } | ||
502 | fail_remove_deps() { need_luasocket; $luarocks build lualogging && $luarocks remove luasocket; } | ||
503 | fail_remove_missing() { $luarocks remove missing_rock; } | ||
504 | fail_remove_invalid_name() { $luarocks remove invalid.rock; } | ||
505 | |||
506 | test_search_found() { $luarocks search zlib; } | ||
507 | test_search_missing() { $luarocks search missing_rock; } | ||
508 | test_search_version() { $luarocks search zlib 1.1; } | ||
509 | test_search_all() { $luarocks search --all; } | ||
510 | fail_search_nostring() { $var=123; $luarocks search $var; } | ||
511 | |||
512 | test_show() { $luarocks show luacov; } | ||
513 | test_show_modules() { $luarocks show --modules luacov; } | ||
514 | test_show_home() { $luarocks show --home luacov; } | ||
515 | test_show_deps() { $luarocks show --deps luacov; } | ||
516 | test_show_rockspec() { $luarocks show --rockspec luacov; } | ||
517 | test_show_mversion() { $luarocks show --mversion luacov; } | ||
518 | test_show_rocktree() { $luarocks show --rock-tree luacov; } | ||
519 | test_show_rockdir() { $luarocks show --rock-dir luacov; } | ||
520 | test_show_depends() { need_luasocket; $luarocks install $luasec && $luarocks show luasec; } | ||
521 | test_show_oldversion() { $luarocks install luacov ${version_luacov} && $luarocks show luacov ${version_luacov}; } | ||
522 | |||
523 | test_unpack_download() { rm -rf ./cprint-${verrev_cprint} && $luarocks unpack cprint && rm -rf ./cprint-${verrev_cprint}; } | ||
524 | test_unpack_src() { rm -rf ./cprint-${verrev_cprint} && $luarocks download --source cprint && $luarocks unpack ./cprint-${verrev_cprint}.src.rock && rm -rf ./cprint-${verrev_cprint}; } | ||
525 | test_unpack_rockspec() { rm -rf ./cprint-${verrev_cprint} && $luarocks download --rockspec cprint && $luarocks unpack ./cprint-${verrev_cprint}.rockspec && rm -rf ./cprint-${verrev_cprint}; } | ||
526 | test_unpack_binary() { rm -rf ./cprint-${verrev_cprint} && $luarocks build cprint && $luarocks pack cprint && $luarocks unpack ./cprint-${verrev_cprint}.${platform}.rock && rm -rf ./cprint-${verrev_cprint}; } | ||
527 | fail_unpack_invalidpatch() { need_luasocket; $luarocks unpack "$testing_dir/testfiles/invalid_patch-0.1-1.rockspec"; } | ||
528 | fail_unpack_invalidrockspec() { need_luasocket; $luarocks unpack "invalid.rockspec"; } | ||
529 | |||
530 | fail_upload_invalidrockspec() { $luarocks upload "invalid.rockspec"; } | ||
531 | fail_upload_invalidkey() { $luarocks upload --api-key="invalid" "invalid.rockspec"; } | ||
532 | fail_upload_skippack() { $luarocks upload --api-key="invalid" --skip-pack "luacov-${verrev_luacov}.rockspec"; } | ||
533 | fail_upload_force() { $luarocks install lua-cjson && $luarocks upload --api-key="invalid" --force "luacov-${verrev_luacov}.rockspec" && $luarocks remove lua-cjson; } | ||
534 | |||
535 | |||
536 | test_admin_help() { $luarocks_admin help; } | ||
537 | |||
538 | test_admin_make_manifest() { $luarocks_admin make_manifest; } | ||
539 | test_admin_add_rsync() { $luarocks_admin --server=testing add "$testing_server/luasocket-${verrev_luasocket}.src.rock"; } | ||
540 | test_admin_add_sftp() { export LUAROCKS_CONFIG="$testing_dir/testing_config_sftp.lua" && $luarocks_admin --server=testing add ./luasocket-${verrev_luasocket}.src.rock; export LUAROCKS_CONFIG="$testing_dir/testing_config.lua"; } | ||
541 | fail_admin_add_missing() { $luarocks_admin --server=testing add; } | ||
542 | fail_admin_invalidserver() { $luarocks_admin --server=invalid add "$testing_server/luasocket-${verrev_luasocket}.src.rock"; } | ||
543 | fail_admin_invalidrock() { $luarocks_admin --server=testing add invalid; } | ||
544 | test_admin_refresh_cache() { $luarocks_admin --server=testing refresh_cache; } | ||
545 | test_admin_remove() { $luarocks_admin --server=testing remove luasocket-${verrev_luasocket}.src.rock; } | ||
546 | fail_admin_remove_missing() { $luarocks_admin --server=testing remove; } | ||
547 | fail_admin_split_server_url() { $luarocks_admin --server="localhost@/tmp/luarocks_testing" add "$testing_server/luasocket-${verrev_luasocket}.src.rock"; } | ||
548 | |||
549 | fail_deps_mode_invalid_arg() { $luarocks remove luacov --deps-mode; } | ||
550 | test_deps_mode_one() { $luarocks build --tree="system" lpeg && $luarocks list && $luarocks build --deps-mode=one --tree="$testing_tree" lxsh && [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 1 ]; } | ||
551 | test_deps_mode_order() { $luarocks build --tree="system" lpeg && $luarocks build --deps-mode=order --tree="$testing_tree" lxsh && $luarocks_noecho list --tree="$testing_tree" --porcelain lpeg && [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; } | ||
552 | test_deps_mode_order_sys() { $luarocks build --tree="$testing_tree" lpeg && $luarocks build --deps-mode=order --tree="$testing_sys_tree" lxsh && [ `$luarocks_noecho list --tree="$testing_sys_tree" --porcelain lpeg | wc -l` = 1 ]; } | ||
553 | test_deps_mode_all_sys() { $luarocks build --tree="$testing_tree" lpeg && $luarocks build --deps-mode=all --tree="$testing_sys_tree" lxsh && [ `$luarocks_noecho list --tree="$testing_sys_tree" --porcelain lpeg | wc -l` = 0 ]; } | ||
554 | test_deps_mode_none() { $luarocks build --tree="$testing_tree" --deps-mode=none lxsh; [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; } | ||
555 | test_deps_mode_nodeps_alias() { $luarocks build --tree="$testing_tree" --nodeps lxsh; [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; } | ||
556 | test_deps_mode_make_order() { $luarocks build --tree="$testing_sys_tree" lpeg && rm -rf ./lxsh-${verrev_lxsh} && $luarocks download --source lxsh ${verrev_lxsh} && $luarocks unpack ./lxsh-${verrev_lxsh}.src.rock && cd lxsh-${verrev_lxsh}/lxsh-${version_lxsh}-1 && $luarocks make --tree="$testing_tree" --deps-mode=order && cd ../.. && [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ] && rm -rf ./lxsh-${verrev_lxsh}; } | ||
557 | test_deps_mode_make_order_sys() { $luarocks build --tree="$testing_tree" lpeg && rm -rf ./lxsh-${verrev_lxsh} && $luarocks download --source lxsh ${verrev_lxsh} && $luarocks unpack ./lxsh-${verrev_lxsh}.src.rock && cd lxsh-${verrev_lxsh}/lxsh-${version_lxsh}-1 && $luarocks make --tree="$testing_sys_tree" --deps-mode=order && cd ../.. && [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 1 ] && rm -rf ./lxsh-${verrev_lxsh}; } | ||
558 | |||
559 | test_write_rockspec() { $luarocks write_rockspec git://github.com/keplerproject/luarocks; } | ||
560 | test_write_rockspec_name() { $luarocks write_rockspec luarocks git://github.com/keplerproject/luarocks; } | ||
561 | test_write_rockspec_name_version() { $luarocks write_rockspec luarocks 7.8.9 git://github.com/keplerproject/luarocks; } | ||
562 | test_write_rockspec_current_dir() { $luarocks write_rockspec; } | ||
563 | test_write_rockspec_tag() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --tag=v2.3.0; } | ||
564 | test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; } | ||
565 | test_write_rockspec_format() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --rockspec-format=1.1 --lua-version=5.1,5.2; } | ||
566 | test_write_rockspec_fullargs() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --lua-version=5.1,5.2 --license="MIT/X11" --homepage="http://www.luarocks.org" --summary="A package manager for Lua modules"; } | ||
567 | fail_write_rockspec_args() { $luarocks write_rockspec invalid; } | ||
568 | fail_write_rockspec_args_url() { $luarocks write_rockspec http://example.com/invalid.zip; } | ||
569 | test_write_rockspec_http() { $luarocks write_rockspec http://luarocks.org/releases/luarocks-2.1.0.tar.gz --lua-version=5.1; } | ||
570 | test_write_rockspec_basedir() { $luarocks write_rockspec https://github.com/downloads/Olivine-Labs/luassert/luassert-1.2.tar.gz --lua-version=5.1; } | ||
571 | |||
572 | fail_config_noflags() { $luarocks config; } | ||
573 | test_config_lua_incdir() { $luarocks config --lua-incdir; } | ||
574 | test_config_lua_libdir() { $luarocks config --lua-libdir; } | ||
575 | test_config_lua_ver() { $luarocks config --lua-ver; } | ||
576 | fail_config_system_config() { rm -f "$testing_lrprefix/etc/luarocks/config.lua"; $luarocks config --system-config; } | ||
577 | test_config_system_config() { mkdir -p "$testing_lrprefix/etc/luarocks"; touch "$testing_lrprefix/etc/luarocks/config.lua"; $luarocks config --system-config; err=$?; rm -f "$testing_lrprefix/etc/luarocks/config.lua"; return $err; } | ||
578 | fail_config_system_config_invalid() { mkdir -p "$testing_lrprefix/etc/luarocks"; echo "if if if" > "$testing_lrprefix/etc/luarocks/config.lua"; $luarocks config --system-config; err=$?; rm -f "$testing_lrprefix/etc/luarocks/config.lua"; return $err; } | ||
579 | test_config_user_config() { $luarocks config --user-config; } | ||
580 | test_config_rock_trees() { $luarocks config --rock-trees; } | ||
581 | test_config_help() { $luarocks help config; } | ||
582 | |||
583 | # Tests for https://github.com/keplerproject/luarocks/issues/375 | ||
584 | test_fetch_base_dir() { $lua <<EOF | ||
585 | local fetch = require "luarocks.fetch" | ||
586 | |||
587 | assert("v0.3" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3.zip")) | ||
588 | assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.zip")) | ||
589 | assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.gz")) | ||
590 | assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.bz2")) | ||
591 | assert("parser.moon" == fetch.url_to_base_dir("git://github.com/Cirru/parser.moon")) | ||
592 | assert("v0.3" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3")) | ||
593 | EOF | ||
594 | } | ||
595 | |||
596 | test_luajit_dependency() { | ||
597 | if [ "$is_jit" = 1 ] | ||
598 | then $luarocks build "$testing_dir/testfiles/luajit-success-1.0-1.rockspec" | ||
599 | else true | ||
600 | fi | ||
601 | } | ||
602 | fail_luajit_dependency() { | ||
603 | if [ "$is_jit" = 1 ] | ||
604 | then $luarocks build "$testing_dir/testfiles/luajit-fail-1.0-1.rockspec" | ||
605 | else false | ||
606 | fi | ||
607 | } | ||
608 | |||
609 | test_doc() { $luarocks install luarepl; $luarocks doc luarepl; } | ||
610 | test_doc_home() { $luarocks install luacov; $luarocks doc luacov --home; } | ||
611 | fail_doc_invalid() { $luarocks doc invalid; } | ||
612 | test_doc_list() { $luarocks install luacov; $luarocks doc luacov --list; } | ||
613 | test_doc_local() { $luarocks install luacov; $luarocks doc luacov --local; } | ||
614 | test_doc_porcelain() { $luarocks install luacov; $luarocks doc luacov --porcelain; } | ||
615 | |||
616 | # Tests for https://github.com/keplerproject/luarocks/pull/552 | ||
617 | test_install_break_dependencies_warning() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install say ${old_version_say}; } | ||
618 | test_install_break_dependencies_force() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install --force say ${old_version_say}; } | ||
619 | test_install_break_dependencies_forcefast() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install --force-fast say ${old_version_say}; } | ||
620 | |||
621 | # Driver ######################################### | ||
622 | run_tests() { | ||
623 | grep "^test_$1.*(" < $testing_dir/testing.sh | cut -d'(' -f1 | while read test | ||
624 | do | ||
625 | echo "-------------------------------------------" | ||
626 | echo "$test" | ||
627 | echo "-------------------------------------------" | ||
628 | reset_environment | ||
629 | if $test | ||
630 | then | ||
631 | echo "OK: Expected success." | ||
632 | else | ||
633 | if [ $? = 99 ] | ||
634 | then echo "FAIL: Unexpected crash!"; exit 99 | ||
635 | fi | ||
636 | echo "FAIL: Unexpected failure."; exit 1 | ||
637 | fi | ||
638 | done | ||
639 | grep "^fail_$1.*(" < $testing_dir/testing.sh | cut -d'(' -f1 | while read test | ||
640 | do | ||
641 | echo "-------------------------------------------" | ||
642 | echo "$test" | ||
643 | echo "-------------------------------------------" | ||
644 | reset_environment | ||
645 | if $test | ||
646 | then echo "FAIL: Unexpected success."; exit 1 | ||
647 | else | ||
648 | if [ $? = 99 ] | ||
649 | then echo "FAIL: Unexpected crash!"; exit 99 | ||
650 | fi | ||
651 | echo "OK: Expected failure." | ||
652 | fi | ||
653 | done | ||
654 | } | ||
655 | |||
656 | run_with_minimal_environment() { | ||
657 | echo "===========================================" | ||
658 | echo "Running with minimal environment" | ||
659 | echo "===========================================" | ||
660 | build_environment luacov | ||
661 | run_tests $1 | ||
662 | } | ||
663 | |||
664 | run_with_full_environment() { | ||
665 | echo "===========================================" | ||
666 | echo "Running with full environment" | ||
667 | echo "===========================================" | ||
668 | |||
669 | local bitop= | ||
670 | [ "$luaversion" = "5.1.5" ] && bitop=luabitop | ||
671 | |||
672 | build_environment luacov luafilesystem luasocket $bitop luaposix md5 lzlib | ||
673 | run_tests $1 | ||
674 | } | ||
675 | |||
676 | run_all_tests() { | ||
677 | run_with_minimal_environment $1 | ||
678 | run_with_full_environment $1 | ||
679 | } | ||
680 | |||
681 | run_all_tests $1 | ||
682 | #run_with_minimal_environment $1 | ||
683 | |||
684 | cd "$testing_dir/.." | ||
685 | |||
686 | if [ "$travis" ] | ||
687 | then | ||
688 | if [ "$TRAVIS" ] | ||
689 | then | ||
690 | build_environment luacov luafilesystem luacov-coveralls | ||
691 | $testing_sys_tree/bin/luacov-coveralls -c "$testing_dir/luacov.config" || echo "ok" | ||
692 | fi | ||
693 | $testing_sys_tree/bin/luacov -c "$testing_dir/luacov.config" | ||
694 | grep "Summary" -B1 -A1000 "$testing_dir/luacov.report.out" | ||
695 | else | ||
696 | $testing_sys_tree/bin/luacov -c "$testing_dir/luacov.config" | ||
697 | cat "$testing_dir/luacov.report.out" | ||
698 | fi | ||