diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2013-10-29 21:57:54 -0200 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2013-10-29 21:57:54 -0200 |
| commit | 88e21b5552ba09fb2ebbb38001884ac30b03e652 (patch) | |
| tree | d44fb29002bddb394733fc215cc201dac4cc1cd1 | |
| parent | 1ab2ca97e9900747c2f08810c4a6ea823435588c (diff) | |
| download | luarocks-88e21b5552ba09fb2ebbb38001884ac30b03e652.tar.gz luarocks-88e21b5552ba09fb2ebbb38001884ac30b03e652.tar.bz2 luarocks-88e21b5552ba09fb2ebbb38001884ac30b03e652.zip | |
Improve coverage -- now at 80.06%
| -rwxr-xr-x | test/testing.sh | 22 |
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 | ||
| 10 | if [ -z "$@"] | 10 | if [ -z "$@" ] |
| 11 | then | 11 | then |
| 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" | |||
| 32 | rm -rf "$testing_tree_copy" | 32 | rm -rf "$testing_tree_copy" |
| 33 | rm -rf "$testing_sys_tree_copy" | 33 | rm -rf "$testing_sys_tree_copy" |
| 34 | rm -rf "$testing_cache" | 34 | rm -rf "$testing_cache" |
| 35 | rm -rf "$testing_dir/testing_config.lua" | ||
| 36 | rm -rf "$testing_dir/testing_config_show_downloads.lua" | ||
| 37 | rm -rf "$testing_dir/testing_config_sftp.lua" | ||
| 38 | rm -rf "$testing_dir/luacov.config" | ||
| 39 | |||
| 40 | [ "$1" = "clean" ] && { | ||
| 41 | rm -f luacov.stats.out | ||
| 42 | exit 0 | ||
| 43 | } | ||
| 35 | 44 | ||
| 36 | cat <<EOF > $testing_dir/testing_config.lua | 45 | cat <<EOF > $testing_dir/testing_config.lua |
| 37 | rocks_trees = { | 46 | rocks_trees = { |
| @@ -47,6 +56,10 @@ upload_servers = { | |||
| 47 | }, | 56 | }, |
| 48 | } | 57 | } |
| 49 | EOF | 58 | EOF |
| 59 | ( | ||
| 60 | cat $testing_dir/testing_config.lua | ||
| 61 | echo "show_downloads = true" | ||
| 62 | ) > $testing_dir/testing_config_show_downloads.lua | ||
| 50 | cat <<EOF > $testing_dir/testing_config_sftp.lua | 63 | cat <<EOF > $testing_dir/testing_config_sftp.lua |
| 51 | rocks_trees = { | 64 | rocks_trees = { |
| 52 | "$testing_tree", | 65 | "$testing_tree", |
| @@ -151,6 +164,7 @@ fail_search_noarg() { $luarocks search; } | |||
| 151 | fail_show_noarg() { $luarocks show; } | 164 | fail_show_noarg() { $luarocks show; } |
| 152 | fail_unpack_noarg() { $luarocks unpack; } | 165 | fail_unpack_noarg() { $luarocks unpack; } |
| 153 | fail_new_version_noarg() { $luarocks new_version; } | 166 | fail_new_version_noarg() { $luarocks new_version; } |
| 167 | fail_write_rockspec_noarg() { $luarocks write_rockspec; } | ||
| 154 | 168 | ||
| 155 | fail_build_invalid() { $luarocks build invalid; } | 169 | fail_build_invalid() { $luarocks build invalid; } |
| 156 | fail_download_invalid() { $luarocks download invalid; } | 170 | fail_download_invalid() { $luarocks download invalid; } |
| @@ -170,6 +184,9 @@ fail_build_nohttps() { $luarocks install luasocket && $luarocks download --rocks | |||
| 170 | test_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; } | 184 | test_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; } |
| 171 | test_build_supported_platforms() { $luarocks build xctrl; } | 185 | test_build_supported_platforms() { $luarocks build xctrl; } |
| 172 | 186 | ||
| 187 | test_build_deps_partial_match() { $luarocks build yaml; } | ||
| 188 | 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"; } | ||
| 189 | |||
| 173 | test_download_all() { $luarocks download --all validate-args && rm validate-args-*; } | 190 | test_download_all() { $luarocks download --all validate-args && rm validate-args-*; } |
| 174 | test_download_rockspecversion() { $luarocks download --rockspec validate-args ${version_validate_args} && rm validate-args-*; } | 191 | test_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/ | |||
| 239 | test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; } | 256 | test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; } |
| 240 | 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"; } | 257 | 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"; } |
| 241 | fail_write_rockspec_args() { $luarocks write_rockspec invalid; } | 258 | fail_write_rockspec_args() { $luarocks write_rockspec invalid; } |
| 259 | fail_write_rockspec_args_url() { $luarocks write_rockspec http://example.com/invalid.zip; } | ||
| 260 | test_write_rockspec_http() { $luarocks write_rockspec http://luarocks.org/releases/luarocks-2.1.0.tar.gz --lua-version=5.1; } | ||
| 261 | test_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 | ||
