aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2013-10-29 21:57:54 -0200
committerHisham Muhammad <hisham@gobolinux.org>2013-10-29 21:57:54 -0200
commit88e21b5552ba09fb2ebbb38001884ac30b03e652 (patch)
treed44fb29002bddb394733fc215cc201dac4cc1cd1
parent1ab2ca97e9900747c2f08810c4a6ea823435588c (diff)
downloadluarocks-88e21b5552ba09fb2ebbb38001884ac30b03e652.tar.gz
luarocks-88e21b5552ba09fb2ebbb38001884ac30b03e652.tar.bz2
luarocks-88e21b5552ba09fb2ebbb38001884ac30b03e652.zip
Improve coverage -- now at 80.06%
-rwxr-xr-xtest/testing.sh22
1 files changed, 21 insertions, 1 deletions
diff --git a/test/testing.sh b/test/testing.sh
index 5eb35e56..6b8be3ab 100755
--- a/test/testing.sh
+++ b/test/testing.sh
@@ -7,7 +7,7 @@
7 exit 1 7 exit 1
8} 8}
9 9
10if [ -z "$@"] 10if [ -z "$@" ]
11then 11then
12 ps aux | grep -q '[s]shd' || { 12 ps aux | grep -q '[s]shd' || {
13 echo "Run sudo /bin/sshd in order to perform all tests." 13 echo "Run sudo /bin/sshd in order to perform all tests."
@@ -32,6 +32,15 @@ rm -rf "$testing_sys_tree"
32rm -rf "$testing_tree_copy" 32rm -rf "$testing_tree_copy"
33rm -rf "$testing_sys_tree_copy" 33rm -rf "$testing_sys_tree_copy"
34rm -rf "$testing_cache" 34rm -rf "$testing_cache"
35rm -rf "$testing_dir/testing_config.lua"
36rm -rf "$testing_dir/testing_config_show_downloads.lua"
37rm -rf "$testing_dir/testing_config_sftp.lua"
38rm -rf "$testing_dir/luacov.config"
39
40[ "$1" = "clean" ] && {
41 rm -f luacov.stats.out
42 exit 0
43}
35 44
36cat <<EOF > $testing_dir/testing_config.lua 45cat <<EOF > $testing_dir/testing_config.lua
37rocks_trees = { 46rocks_trees = {
@@ -47,6 +56,10 @@ upload_servers = {
47 }, 56 },
48} 57}
49EOF 58EOF
59(
60 cat $testing_dir/testing_config.lua
61 echo "show_downloads = true"
62) > $testing_dir/testing_config_show_downloads.lua
50cat <<EOF > $testing_dir/testing_config_sftp.lua 63cat <<EOF > $testing_dir/testing_config_sftp.lua
51rocks_trees = { 64rocks_trees = {
52 "$testing_tree", 65 "$testing_tree",
@@ -151,6 +164,7 @@ fail_search_noarg() { $luarocks search; }
151fail_show_noarg() { $luarocks show; } 164fail_show_noarg() { $luarocks show; }
152fail_unpack_noarg() { $luarocks unpack; } 165fail_unpack_noarg() { $luarocks unpack; }
153fail_new_version_noarg() { $luarocks new_version; } 166fail_new_version_noarg() { $luarocks new_version; }
167fail_write_rockspec_noarg() { $luarocks write_rockspec; }
154 168
155fail_build_invalid() { $luarocks build invalid; } 169fail_build_invalid() { $luarocks build invalid; }
156fail_download_invalid() { $luarocks download invalid; } 170fail_download_invalid() { $luarocks download invalid; }
@@ -170,6 +184,9 @@ fail_build_nohttps() { $luarocks install luasocket && $luarocks download --rocks
170test_build_https() { $luarocks download --rockspec validate-args ${version_validate_args} && $luarocks install luasec && $luarocks build ./validate-args-${version_validate_args}-1.rockspec && rm ./validate-args-${version_validate_args}-1.rockspec; } 184test_build_https() { $luarocks download --rockspec validate-args ${version_validate_args} && $luarocks install luasec && $luarocks build ./validate-args-${version_validate_args}-1.rockspec && rm ./validate-args-${version_validate_args}-1.rockspec; }
171test_build_supported_platforms() { $luarocks build xctrl; } 185test_build_supported_platforms() { $luarocks build xctrl; }
172 186
187test_build_deps_partial_match() { $luarocks build yaml; }
188test_build_show_downloads() { export LUAROCKS_CONFIG="$testing_dir/testing_config_show_downloads.lua" && $luarocks build alien; export LUAROCKS_CONFIG="$testing_dir/testing_config.lua"; }
189
173test_download_all() { $luarocks download --all validate-args && rm validate-args-*; } 190test_download_all() { $luarocks download --all validate-args && rm validate-args-*; }
174test_download_rockspecversion() { $luarocks download --rockspec validate-args ${version_validate_args} && rm validate-args-*; } 191test_download_rockspecversion() { $luarocks download --rockspec validate-args ${version_validate_args} && rm validate-args-*; }
175 192
@@ -239,6 +256,9 @@ test_write_rockspec() { $luarocks write_rockspec git://github.com/keplerproject/
239test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; } 256test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; }
240test_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"; } 257test_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"; }
241fail_write_rockspec_args() { $luarocks write_rockspec invalid; } 258fail_write_rockspec_args() { $luarocks write_rockspec invalid; }
259fail_write_rockspec_args_url() { $luarocks write_rockspec http://example.com/invalid.zip; }
260test_write_rockspec_http() { $luarocks write_rockspec http://luarocks.org/releases/luarocks-2.1.0.tar.gz --lua-version=5.1; }
261test_write_rockspec_basedir() { $luarocks write_rockspec https://github.com/downloads/Olivine-Labs/luassert/luassert-1.2.tar.gz --lua-version=5.1; }
242 262
243# Driver ######################################### 263# Driver #########################################
244 264