diff options
-rw-r--r-- | README.md | 9 | ||||
-rw-r--r-- | src/luarocks/download.lua | 21 | ||||
-rwxr-xr-x | test/testing.sh | 170 |
3 files changed, 162 insertions, 38 deletions
@@ -1,8 +1,13 @@ | |||
1 | This is LuaRocks, a deployment and management system for Lua modules. | 1 | LuaRocks |
2 | ======== | ||
3 | |||
4 | A package manager for Lua modules. | ||
5 | |||
6 | [](https://travis-ci.org/keplerproject/luarocks) | ||
2 | 7 | ||
3 | Main website: [luarocks.org](http://www.luarocks.org) | 8 | Main website: [luarocks.org](http://www.luarocks.org) |
4 | 9 | ||
5 | LuaRocks allows you to install Lua modules as self-contained packages called | 10 | It allows you to install Lua modules as self-contained packages called |
6 | [*rocks*][1], which also contain version [dependency][2] information. This | 11 | [*rocks*][1], which also contain version [dependency][2] information. This |
7 | information is used both during installation, so that when one rock is | 12 | information is used both during installation, so that when one rock is |
8 | requested all rocks it depends on are installed as well, and at run time, so | 13 | requested all rocks it depends on are installed as well, and at run time, so |
diff --git a/src/luarocks/download.lua b/src/luarocks/download.lua index 0012cb18..d0f672f2 100644 --- a/src/luarocks/download.lua +++ b/src/luarocks/download.lua | |||
@@ -7,6 +7,8 @@ local util = require("luarocks.util") | |||
7 | local path = require("luarocks.path") | 7 | local path = require("luarocks.path") |
8 | local fetch = require("luarocks.fetch") | 8 | local fetch = require("luarocks.fetch") |
9 | local search = require("luarocks.search") | 9 | local search = require("luarocks.search") |
10 | local fs = require("luarocks.fs") | ||
11 | local dir = require("luarocks.dir") | ||
10 | 12 | ||
11 | help_summary = "Download a specific rock file from a rocks server." | 13 | help_summary = "Download a specific rock file from a rocks server." |
12 | help_arguments = "[--all] [--arch=<arch> | --source | --rockspec] [<name> [<version>]]" | 14 | help_arguments = "[--all] [--arch=<arch> | --source | --rockspec] [<name> [<version>]]" |
@@ -18,6 +20,20 @@ help = [[ | |||
18 | --arch=<arch> Download rock for a specific architecture. | 20 | --arch=<arch> Download rock for a specific architecture. |
19 | ]] | 21 | ]] |
20 | 22 | ||
23 | local function get_file(filename) | ||
24 | local protocol, pathname = dir.split_url(filename) | ||
25 | if protocol == "file" then | ||
26 | local ok, err = fs.copy(pathname, fs.current_dir()) | ||
27 | if ok then | ||
28 | return pathname | ||
29 | else | ||
30 | return nil, err | ||
31 | end | ||
32 | else | ||
33 | return fetch.fetch_url(filename) | ||
34 | end | ||
35 | end | ||
36 | |||
21 | function download(arch, name, version, all) | 37 | function download(arch, name, version, all) |
22 | local results, err | 38 | local results, err |
23 | local query = search.make_query(name, version) | 39 | local query = search.make_query(name, version) |
@@ -29,8 +45,7 @@ function download(arch, name, version, all) | |||
29 | results, err = search.find_suitable_rock(query) | 45 | results, err = search.find_suitable_rock(query) |
30 | end | 46 | end |
31 | if type(results) == "string" then | 47 | if type(results) == "string" then |
32 | local file = fetch.fetch_url(results) | 48 | return get_file(results) |
33 | return file | ||
34 | elseif type(results) == "table" and next(results) then | 49 | elseif type(results) == "table" and next(results) then |
35 | if all then | 50 | if all then |
36 | local all_ok = true | 51 | local all_ok = true |
@@ -39,7 +54,7 @@ function download(arch, name, version, all) | |||
39 | for version, versions in pairs(result) do | 54 | for version, versions in pairs(result) do |
40 | for _,items in pairs(versions) do | 55 | for _,items in pairs(versions) do |
41 | local filename = path.make_url(items.repo, name, version, items.arch) | 56 | local filename = path.make_url(items.repo, name, version, items.arch) |
42 | local ok, err = fetch.fetch_url(filename) | 57 | local ok, err = get_file(filename) |
43 | if not ok then | 58 | if not ok then |
44 | all_ok = false | 59 | all_ok = false |
45 | any_err = any_err .. "\n" .. err | 60 | any_err = any_err .. "\n" .. err |
diff --git a/test/testing.sh b/test/testing.sh index bce65294..ec42bb56 100755 --- a/test/testing.sh +++ b/test/testing.sh | |||
@@ -28,6 +28,7 @@ testing_sys_tree="$testing_dir/testing_sys" | |||
28 | testing_tree_copy="$testing_dir/testing_copy" | 28 | testing_tree_copy="$testing_dir/testing_copy" |
29 | testing_sys_tree_copy="$testing_dir/testing_sys_copy" | 29 | testing_sys_tree_copy="$testing_dir/testing_sys_copy" |
30 | testing_cache="$testing_dir/testing_cache" | 30 | testing_cache="$testing_dir/testing_cache" |
31 | testing_server="$testing_dir/testing_server" | ||
31 | 32 | ||
32 | [ "$1" ] || rm -f luacov.stats.out | 33 | [ "$1" ] || rm -f luacov.stats.out |
33 | rm -f luacov.report.out | 34 | rm -f luacov.report.out |
@@ -38,11 +39,14 @@ rm -rf "$testing_sys_tree" | |||
38 | rm -rf "$testing_tree_copy" | 39 | rm -rf "$testing_tree_copy" |
39 | rm -rf "$testing_sys_tree_copy" | 40 | rm -rf "$testing_sys_tree_copy" |
40 | rm -rf "$testing_cache" | 41 | rm -rf "$testing_cache" |
42 | rm -rf "$testing_server" | ||
41 | rm -rf "$testing_dir/testing_config.lua" | 43 | rm -rf "$testing_dir/testing_config.lua" |
42 | rm -rf "$testing_dir/testing_config_show_downloads.lua" | 44 | rm -rf "$testing_dir/testing_config_show_downloads.lua" |
43 | rm -rf "$testing_dir/testing_config_sftp.lua" | 45 | rm -rf "$testing_dir/testing_config_sftp.lua" |
44 | rm -rf "$testing_dir/luacov.config" | 46 | rm -rf "$testing_dir/luacov.config" |
45 | 47 | ||
48 | mkdir -p "$testing_cache" | ||
49 | |||
46 | [ "$1" = "clean" ] && { | 50 | [ "$1" = "clean" ] && { |
47 | rm -f luacov.stats.out | 51 | rm -f luacov.stats.out |
48 | exit 0 | 52 | exit 0 |
@@ -53,6 +57,9 @@ rocks_trees = { | |||
53 | "$testing_tree", | 57 | "$testing_tree", |
54 | "$testing_sys_tree", | 58 | "$testing_sys_tree", |
55 | } | 59 | } |
60 | rocks_servers = { | ||
61 | "$testing_server" | ||
62 | } | ||
56 | local_cache = "$testing_cache" | 63 | local_cache = "$testing_cache" |
57 | upload_server = "testing" | 64 | upload_server = "testing" |
58 | upload_user = "hisham" | 65 | upload_user = "hisham" |
@@ -118,25 +125,36 @@ then | |||
118 | fi | 125 | fi |
119 | popd | 126 | popd |
120 | luadir=/tmp/lua | 127 | luadir=/tmp/lua |
121 | platform="linux-x86_64" | ||
122 | else | 128 | else |
123 | luadir="/Programs/Lua/Current" | 129 | luadir="/Programs/Lua/Current" |
130 | fi | ||
131 | |||
132 | if [ `uname -m` = i686 ] | ||
133 | then | ||
124 | platform="linux-x86" | 134 | platform="linux-x86" |
135 | else | ||
136 | platform="linux-x86_64" | ||
125 | fi | 137 | fi |
138 | |||
126 | lua="$luadir/bin/lua" | 139 | lua="$luadir/bin/lua" |
127 | 140 | ||
128 | version_luasocket=3.0rc1 | 141 | version_luasocket=3.0rc1 |
129 | verrev_luasocket=${version_luasocket}-1 | 142 | verrev_luasocket=${version_luasocket}-1 |
130 | srcdir_luasocket=luasocket-3.0-rc1 | 143 | srcdir_luasocket=luasocket-3.0-rc1 |
131 | 144 | ||
132 | version_luacov=0.3 | 145 | version_cprint=0.1 |
146 | verrev_cprint=0.1-1 | ||
147 | |||
148 | version_luacov=0.4 | ||
149 | verrev_luacov=0.4-1 | ||
133 | version_lxsh=0.8.6 | 150 | version_lxsh=0.8.6 |
134 | version_validate_args=1.5.4 | 151 | version_validate_args=1.5.4 |
152 | verrev_validate_args=1.5.4-1 | ||
135 | verrev_lxsh=${version_lxsh}-2 | 153 | verrev_lxsh=${version_lxsh}-2 |
136 | 154 | ||
137 | # will change to luasec=luasec once LuaSec for Lua 5.2 is released | 155 | # will change to luasec=luasec once LuaSec for Lua 5.2 is released |
138 | luasec="http://luarocks.org/repositories/rocks-scm/luasec-scm-1.rockspec" | 156 | #luasec="http://luarocks.org/repositories/rocks-scm/luasec-scm-1.rockspec" |
139 | #luasec=luasec | 157 | luasec=luasec |
140 | 158 | ||
141 | cd .. | 159 | cd .. |
142 | ./configure --with-lua="$luadir" | 160 | ./configure --with-lua="$luadir" |
@@ -144,14 +162,70 @@ make clean | |||
144 | make src/luarocks/site_config.lua | 162 | make src/luarocks/site_config.lua |
145 | make dev | 163 | make dev |
146 | cd src | 164 | cd src |
165 | basedir=$PWD | ||
166 | run_lua() { | ||
167 | if [ "$1" = "--noecho" ]; then shift; noecho=1; else noecho=0; fi | ||
168 | if [ "$1" = "--nocov" ]; then shift; nocov=1; else nocov=0; fi | ||
169 | if [ "$noecho" = 0 ] | ||
170 | then | ||
171 | echo $* | ||
172 | fi | ||
173 | cmd=$1 | ||
174 | shift | ||
175 | if [ "$nocov" = 0 ] | ||
176 | then | ||
177 | "$lua" -e"require('luacov.runner')('$testing_dir/luacov.config')" "$basedir/bin/$cmd" "$@" | ||
178 | else | ||
179 | "$lua" "$basedir/bin/$cmd" "$@" | ||
180 | fi | ||
181 | } | ||
182 | luarocks="run_lua luarocks" | ||
183 | luarocks_nocov="run_lua --nocov luarocks" | ||
184 | luarocks_noecho="run_lua --noecho luarocks" | ||
185 | luarocks_noecho_nocov="run_lua --noecho --nocov luarocks" | ||
186 | luarocks_admin="run_lua luarocks-admin" | ||
187 | luarocks_admin_nocov="run_lua --nocov luarocks-admin" | ||
147 | 188 | ||
148 | echo $LUA_PATH | 189 | ################################################### |
149 | 190 | ||
150 | luarocks_nocov="$lua $PWD/bin/luarocks" | 191 | if [ ! -d "$testing_server" ] |
151 | luarocks="$lua -erequire('luacov.runner')('$testing_dir/luacov.config') $PWD/bin/luarocks" | 192 | then |
152 | luarocks_admin="$lua -erequire('luacov.runner')('$testing_dir/luacov.config') $PWD/bin/luarocks-admin" | 193 | mkdir "$testing_server" |
194 | ( | ||
195 | cd "$testing_server" | ||
196 | luarocks_repo="http://luarocks.org/repositories/rocks" | ||
197 | luarocks_scm_repo="http://luarocks.org/repositories/rocks-scm" | ||
198 | wget "$luarocks_repo/luacov-${verrev_luacov}.src.rock" | ||
199 | wget "$luarocks_repo/luacov-${verrev_luacov}.rockspec" | ||
200 | wget "$luarocks_repo/luadoc-3.0.1-1.src.rock" | ||
201 | wget "$luarocks_repo/lualogging-1.3.0-1.src.rock" | ||
202 | wget "$luarocks_repo/luasocket-${verrev_luasocket}.src.rock" | ||
203 | wget "$luarocks_repo/luasocket-${verrev_luasocket}.rockspec" | ||
204 | wget "$luarocks_repo/luafilesystem-1.6.2-1.src.rock" | ||
205 | wget "$luarocks_repo/stdlib-35-1.src.rock" | ||
206 | wget "$luarocks_repo/luarepl-0.4-1.src.rock" | ||
207 | wget "$luarocks_repo/validate-args-1.5.4-1.rockspec" | ||
208 | wget "$luarocks_scm_repo/luasec-scm-1.rockspec" | ||
209 | wget "$luarocks_repo/luabitop-1.0.2-1.rockspec" | ||
210 | wget "$luarocks_repo/lpty-1.0.1-1.src.rock" | ||
211 | wget "$luarocks_repo/cprint-${verrev_cprint}.src.rock" | ||
212 | wget "$luarocks_repo/cprint-${verrev_cprint}.rockspec" | ||
213 | wget "$luarocks_repo/wsapi-1.6-1.src.rock" | ||
214 | wget "$luarocks_repo/lxsh-${verrev_lxsh}.src.rock" | ||
215 | wget "$luarocks_repo/abelhas-1.0-1.rockspec" | ||
216 | wget "$luarocks_repo/lzlib-0.4.work3-1.src.rock" | ||
217 | wget "$luarocks_repo/lpeg-0.12-1.src.rock" | ||
218 | wget "$luarocks_repo/luaposix-31-1.src.rock" | ||
219 | wget "$luarocks_repo/md5-1.2-1.src.rock" | ||
220 | ) | ||
221 | $luarocks_admin_nocov make_manifest "$testing_server" | ||
222 | fi | ||
153 | 223 | ||
154 | $luarocks_nocov download luacov | 224 | ################################################### |
225 | |||
226 | checksum_path() { | ||
227 | ( cd "$1"; find . -printf "%s %p\n" | md5sum ) | ||
228 | } | ||
155 | 229 | ||
156 | build_environment() { | 230 | build_environment() { |
157 | rm -rf "$testing_tree" | 231 | rm -rf "$testing_tree" |
@@ -164,17 +238,47 @@ build_environment() { | |||
164 | do | 238 | do |
165 | $luarocks_nocov build --tree="$testing_sys_tree" $package | 239 | $luarocks_nocov build --tree="$testing_sys_tree" $package |
166 | done | 240 | done |
167 | eval `$luarocks_nocov path --bin` | 241 | eval `$luarocks_noecho_nocov path --bin` |
168 | cp -a "$testing_tree" "$testing_tree_copy" | 242 | cp -a "$testing_tree" "$testing_tree_copy" |
169 | cp -a "$testing_sys_tree" "$testing_sys_tree_copy" | 243 | cp -a "$testing_sys_tree" "$testing_sys_tree_copy" |
244 | testing_tree_copy_md5=`checksum_path "$testing_tree_copy"` | ||
245 | testing_sys_tree_copy_md5=`checksum_path "$testing_sys_tree_copy"` | ||
170 | } | 246 | } |
171 | 247 | ||
172 | reset_environment() { | 248 | reset_environment() { |
173 | rm -rf "$testing_tree" | 249 | testing_tree_md5=`checksum_path "$testing_tree"` |
174 | rm -rf "$testing_sys_tree" | 250 | testing_sys_tree_md5=`checksum_path "$testing_sys_tree"` |
175 | cp -a "$testing_tree_copy" "$testing_tree" | 251 | if [ "$testing_tree_md5" != "$testing_tree_copy_md5" ] |
176 | cp -a "$testing_sys_tree_copy" "$testing_sys_tree" | 252 | then |
253 | rm -rf "$testing_tree" | ||
254 | cp -a "$testing_tree_copy" "$testing_tree" | ||
255 | fi | ||
256 | if [ "$testing_sys_tree_md5" != "$testing_sys_tree_copy_md5" ] | ||
257 | then | ||
258 | rm -rf "$testing_sys_tree" | ||
259 | cp -a "$testing_sys_tree_copy" "$testing_sys_tree" | ||
260 | fi | ||
261 | } | ||
262 | |||
263 | need() { | ||
264 | echo "Obtaining $1 $2..." | ||
265 | if $luarocks show $1 &> /dev/null | ||
266 | then | ||
267 | echo "Already available" | ||
268 | return | ||
269 | fi | ||
270 | platrock="$1-$2.$platform.rock" | ||
271 | if [ ! -e "$testing_cache/$platrock" ] | ||
272 | then | ||
273 | echo "Building $1 $2..." | ||
274 | $luarocks_nocov build --pack-binary-rock $1 $2 | ||
275 | mv "$platrock" "$testing_cache" | ||
276 | fi | ||
277 | echo "Installing $1 $2..." | ||
278 | $luarocks_nocov install "$testing_cache/$platrock" | ||
279 | return | ||
177 | } | 280 | } |
281 | need_luasocket() { need luasocket $verrev_luasocket; } | ||
178 | 282 | ||
179 | # Tests ######################################### | 283 | # Tests ######################################### |
180 | 284 | ||
@@ -206,26 +310,26 @@ fail_new_version_invalid() { $luarocks new_version invalid; } | |||
206 | fail_make_norockspec() { $luarocks make; } | 310 | fail_make_norockspec() { $luarocks make; } |
207 | 311 | ||
208 | fail_build_blank_arg() { $luarocks build --tree="" lpeg; } | 312 | fail_build_blank_arg() { $luarocks build --tree="" lpeg; } |
209 | test_build_withpatch() { $luarocks build luadoc; } | 313 | test_build_withpatch() { need_luasocket; $luarocks build luadoc; } |
210 | test_build_diffversion() { $luarocks build luacov ${version_luacov}; } | 314 | test_build_diffversion() { $luarocks build luacov ${version_luacov}; } |
211 | test_build_command() { $luarocks build stdlib; } | 315 | test_build_command() { $luarocks build stdlib; } |
212 | test_build_install_bin() { $luarocks build luarepl; } | 316 | test_build_install_bin() { $luarocks build luarepl; } |
213 | fail_build_nohttps() { $luarocks install luasocket && $luarocks download --rockspec validate-args ${version_validate_args} && $luarocks build ./validate-args-${version_validate_args}-1.rockspec && rm ./validate-args-${version_validate_args}-1.rockspec; } | 317 | fail_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; } |
214 | 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; } | 318 | test_build_https() { need_luasocket; $luarocks download --rockspec validate-args ${verrev_validate_args} && echo xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx && pwd && ls && $luarocks install $luasec && pwd && ls && $luarocks build ./validate-args-${verrev_validate_args}.rockspec && rm ./validate-args-${verrev_validate_args}.rockspec; } |
215 | test_build_supported_platforms() { $luarocks build lpty; } | 319 | test_build_supported_platforms() { $luarocks build lpty; } |
216 | 320 | ||
217 | test_build_deps_partial_match() { if [ "$travis" ]; then return; fi; $luarocks build yaml; } | 321 | test_build_deps_partial_match() { if [ "$travis" ]; then return; fi; $luarocks build yaml; } |
218 | 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"; } | 322 | 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"; } |
219 | 323 | ||
220 | test_download_all() { $luarocks download --all validate-args && rm validate-args-*; } | 324 | test_download_all() { $luarocks download --all validate-args && rm validate-args-*; } |
221 | test_download_rockspecversion() { $luarocks download --rockspec validate-args ${version_validate_args} && rm validate-args-*; } | 325 | test_download_rockspecversion() { $luarocks download --rockspec validate-args ${verrev_validate_args} && rm validate-args-*; } |
222 | 326 | ||
223 | test_help() { $luarocks help; } | 327 | test_help() { $luarocks help; } |
224 | 328 | ||
225 | test_install_binaryrock() { $luarocks build luasocket && $luarocks pack luasocket && $luarocks install ./luasocket-${verrev_luasocket}.${platform}.rock && rm ./luasocket-${verrev_luasocket}.${platform}.rock; } | 329 | test_install_binaryrock() { $luarocks build --pack-binary-rock cprint && $luarocks install ./cprint-${verrev_cprint}.${platform}.rock && rm ./cprint-${verrev_cprint}.${platform}.rock; } |
226 | test_install_with_bin() { $luarocks install wsapi; } | 330 | test_install_with_bin() { $luarocks install wsapi; } |
227 | 331 | ||
228 | test_lint_ok() { $luarocks download --rockspec validate-args ${version_validate_args} && $luarocks lint ./validate-args-${version_validate_args}-1.rockspec && rm ./validate-args-${version_validate_args}-1.rockspec; } | 332 | 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; } |
229 | 333 | ||
230 | test_list() { $luarocks list; } | 334 | test_list() { $luarocks list; } |
231 | test_list_porcelain() { $luarocks list --porcelain; } | 335 | test_list_porcelain() { $luarocks list --porcelain; } |
@@ -254,13 +358,13 @@ test_search_missing() { $luarocks search missing_rock; } | |||
254 | 358 | ||
255 | test_show() { $luarocks show luacov; } | 359 | test_show() { $luarocks show luacov; } |
256 | test_show_modules() { $luarocks show --modules luacov; } | 360 | test_show_modules() { $luarocks show --modules luacov; } |
257 | test_show_depends() { $luarocks install $luasec && $luarocks show luasec; } | 361 | test_show_depends() { need_luasocket; $luarocks install $luasec && $luarocks show luasec; } |
258 | test_show_oldversion() { $luarocks install luacov ${version_luacov} && $luarocks show luacov ${version_luacov}; } | 362 | test_show_oldversion() { $luarocks install luacov ${version_luacov} && $luarocks show luacov ${version_luacov}; } |
259 | 363 | ||
260 | test_unpack_download() { rm -rf ./luasocket-${verrev_luasocket} && $luarocks unpack luasocket && rm -rf ./luasocket-${verrev_luasocket}; } | 364 | test_unpack_download() { rm -rf ./cprint-${verrev_cprint} && $luarocks unpack cprint && rm -rf ./cprint-${verrev_cprint}; } |
261 | test_unpack_src() { rm -rf ./luasocket-${verrev_luasocket} && $luarocks download --src luasocket && $luarocks unpack ./luasocket-${verrev_luasocket}.src.rock && rm -rf ./luasocket-${verrev_luasocket}; } | 365 | test_unpack_src() { rm -rf ./cprint-${verrev_cprint} && $luarocks download --src cprint && $luarocks unpack ./cprint-${verrev_cprint}.src.rock && rm -rf ./cprint-${verrev_cprint}; } |
262 | test_unpack_rockspec() { rm -rf ./luasocket-${verrev_luasocket} && $luarocks download --rockspec luasocket && $luarocks unpack ./luasocket-${verrev_luasocket}.rockspec && rm -rf ./luasocket-${verrev_luasocket}; } | 366 | test_unpack_rockspec() { rm -rf ./cprint-${verrev_cprint} && $luarocks download --rockspec cprint && $luarocks unpack ./cprint-${verrev_cprint}.rockspec && rm -rf ./cprint-${verrev_cprint}; } |
263 | test_unpack_binary() { rm -rf ./luasocket-${verrev_luasocket} && $luarocks build luasocket && $luarocks pack luasocket && $luarocks unpack ./luasocket-${verrev_luasocket}.${platform}.rock && rm -rf ./luasocket-${verrev_luasocket}; } | 367 | 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}; } |
264 | 368 | ||
265 | test_admin_help() { $luarocks_admin help; } | 369 | test_admin_help() { $luarocks_admin help; } |
266 | 370 | ||
@@ -275,14 +379,14 @@ test_admin_remove() { if [ "$travis" ]; then return; fi; $luarocks_admin --serve | |||
275 | fail_admin_remove_missing() { $luarocks_admin --server=testing remove; } | 379 | fail_admin_remove_missing() { $luarocks_admin --server=testing remove; } |
276 | 380 | ||
277 | fail_deps_mode_invalid_arg() { $luarocks remove luacov --deps-mode; } | 381 | fail_deps_mode_invalid_arg() { $luarocks remove luacov --deps-mode; } |
278 | test_deps_mode_one() { $luarocks build --tree="$testing_sys_tree" lpeg && $luarocks list && $luarocks build --deps-mode=one --tree="$testing_tree" lxsh && [ `$luarocks list --tree="$testing_tree" --porcelain lpeg | wc -l` = 1 ]; } | 382 | test_deps_mode_one() { $luarocks build --tree="$testing_sys_tree" lpeg && $luarocks list && $luarocks build --deps-mode=one --tree="$testing_tree" lxsh && [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 1 ]; } |
279 | test_deps_mode_order() { $luarocks build --tree="$testing_sys_tree" lpeg && $luarocks build --deps-mode=order --tree="$testing_tree" lxsh && [ `$luarocks list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; } | 383 | test_deps_mode_order() { $luarocks build --tree="$testing_sys_tree" lpeg && $luarocks build --deps-mode=order --tree="$testing_tree" lxsh && [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; } |
280 | test_deps_mode_order_sys() { $luarocks build --tree="$testing_tree" lpeg && $luarocks build --deps-mode=order --tree="$testing_sys_tree" lxsh && [ `$luarocks list --tree="$testing_sys_tree" --porcelain lpeg | wc -l` = 1 ]; } | 384 | 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 ]; } |
281 | test_deps_mode_all_sys() { $luarocks build --tree="$testing_tree" lpeg && $luarocks build --deps-mode=all --tree="$testing_sys_tree" lxsh && [ `$luarocks list --tree="$testing_sys_tree" --porcelain lpeg | wc -l` = 0 ]; } | 385 | 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 ]; } |
282 | test_deps_mode_none() { $luarocks build --tree="$testing_tree" --deps-mode=none lxsh; [ `$luarocks list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; } | 386 | test_deps_mode_none() { $luarocks build --tree="$testing_tree" --deps-mode=none lxsh; [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; } |
283 | test_deps_mode_nodeps_alias() { $luarocks build --tree="$testing_tree" --nodeps lxsh; [ `$luarocks list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; } | 387 | test_deps_mode_nodeps_alias() { $luarocks build --tree="$testing_tree" --nodeps lxsh; [ `$luarocks_noecho list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ]; } |
284 | test_deps_mode_make_order() { $luarocks build --tree="$testing_sys_tree" lpeg && rm -rf ./lxsh-${verrev_lxsh} && $luarocks download --src 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 list --tree="$testing_tree" --porcelain lpeg | wc -l` = 0 ] && rm -rf ./lxsh-${verrev_lxsh}; } | 388 | test_deps_mode_make_order() { $luarocks build --tree="$testing_sys_tree" lpeg && rm -rf ./lxsh-${verrev_lxsh} && $luarocks download --src 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}; } |
285 | test_deps_mode_make_order_sys() { $luarocks build --tree="$testing_tree" lpeg && rm -rf ./lxsh-${verrev_lxsh} && $luarocks download --src 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 list --tree="$testing_tree" --porcelain lpeg | wc -l` = 1 ] && rm -rf ./lxsh-${verrev_lxsh}; } | 389 | test_deps_mode_make_order_sys() { $luarocks build --tree="$testing_tree" lpeg && rm -rf ./lxsh-${verrev_lxsh} && $luarocks download --src 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}; } |
286 | 390 | ||
287 | test_write_rockspec() { $luarocks write_rockspec git://github.com/keplerproject/luarocks; } | 391 | test_write_rockspec() { $luarocks write_rockspec git://github.com/keplerproject/luarocks; } |
288 | test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; } | 392 | test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; } |