aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHisham <hisham@gobolinux.org>2016-05-25 01:24:58 -0300
committerHisham <hisham@gobolinux.org>2016-05-25 01:24:58 -0300
commit4c12525d1f52bccc71c2a3054d3db328a0577179 (patch)
tree899bca39ac9f2692419a0271306d2f326917e0d7 /test
parent6217339cd4ba6d7ee7f08aa86443032ede033752 (diff)
parenta3650d51e96aef84657cb29e5f52e570fed828c9 (diff)
downloadluarocks-4c12525d1f52bccc71c2a3054d3db328a0577179.tar.gz
luarocks-4c12525d1f52bccc71c2a3054d3db328a0577179.tar.bz2
luarocks-4c12525d1f52bccc71c2a3054d3db328a0577179.zip
Merge branch 'master' of https://github.com/keplerproject/luarocks
Diffstat (limited to 'test')
-rw-r--r--test/testing.lua21
-rwxr-xr-xtest/testing.sh16
2 files changed, 34 insertions, 3 deletions
diff --git a/test/testing.lua b/test/testing.lua
index c37293ee..1a837484 100644
--- a/test/testing.lua
+++ b/test/testing.lua
@@ -459,6 +459,25 @@ local tests = {
459 and assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.bz2")) 459 and assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.bz2"))
460 and assert("parser.moon" == fetch.url_to_base_dir("git://github.com/Cirru/parser.moon")) 460 and assert("parser.moon" == fetch.url_to_base_dir("git://github.com/Cirru/parser.moon"))
461 and assert("v0.3" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3")) 461 and assert("v0.3" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3"))
462 end,
463
464 -- Tests for https://github.com/keplerproject/luarocks/issues/552
465 test_install_break_dependencies_warning = function()
466 need_luasocket()
467 return run "$luarocks install say ${new_version_say}"
468 and run "$luarocks install luassert"
469 and run "$luarocks install say ${old_version_say}"
470 end,
471 test_install_break_dependencies_force = function()
472 need_luasocket()
473 return run "$luarocks install say ${new_version_say}"
474 and run "$luarocks install luassert"
475 and run "$luarocks install --force say ${old_version_say}"
476 end,
477 test_install_break_dependencies_force = function()
478 need_luasocket()
479 return run "$luarocks install say ${new_version_say}"
480 and run "$luarocks install luassert"
481 and run "$luarocks install --force-fast say ${old_version_say}"
462 end 482 end
463
464} 483}
diff --git a/test/testing.sh b/test/testing.sh
index 5269e42a..f56f2aa9 100755
--- a/test/testing.sh
+++ b/test/testing.sh
@@ -179,6 +179,9 @@ srcdir_luasocket=luasocket-3.0-rc1
179version_cprint=0.1 179version_cprint=0.1
180verrev_cprint=0.1-2 180verrev_cprint=0.1-2
181 181
182new_version_say=1.2-1
183old_version_say=1.0-1
184
182version_luacov=0.11.0 185version_luacov=0.11.0
183verrev_luacov=${version_luacov}-1 186verrev_luacov=${version_luacov}-1
184version_lxsh=0.8.6 187version_lxsh=0.8.6
@@ -260,6 +263,9 @@ mkdir -p "$testing_server"
260 get "$luarocks_repo/lua-path-0.2.3-1.src.rock" 263 get "$luarocks_repo/lua-path-0.2.3-1.src.rock"
261 get "$luarocks_repo/lua-cjson-2.1.0-1.src.rock" 264 get "$luarocks_repo/lua-cjson-2.1.0-1.src.rock"
262 get "$luarocks_repo/luacov-coveralls-0.1.1-1.src.rock" 265 get "$luarocks_repo/luacov-coveralls-0.1.1-1.src.rock"
266 get "$luarocks_repo/say-1.2-1.src.rock"
267 get "$luarocks_repo/say-1.0-1.src.rock"
268 get "$luarocks_repo/luassert-1.7.0-1.src.rock"
263) 269)
264$luarocks_admin_nocov make_manifest "$testing_server" 270$luarocks_admin_nocov make_manifest "$testing_server"
265 271
@@ -358,7 +364,6 @@ fail_upload_noarg() { $luarocks upload; }
358fail_remove_noarg() { $luarocks remove; } 364fail_remove_noarg() { $luarocks remove; }
359fail_doc_noarg() { $luarocks doc; } 365fail_doc_noarg() { $luarocks doc; }
360fail_new_version_noarg() { $luarocks new_version; } 366fail_new_version_noarg() { $luarocks new_version; }
361fail_write_rockspec_noarg() { $luarocks write_rockspec; }
362 367
363fail_build_invalid() { $luarocks build invalid; } 368fail_build_invalid() { $luarocks build invalid; }
364fail_download_invalid() { $luarocks download invalid; } 369fail_download_invalid() { $luarocks download invalid; }
@@ -517,6 +522,9 @@ test_deps_mode_make_order() { $luarocks build --tree="$testing_sys_tree" lpeg &&
517test_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}; } 522test_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}; }
518 523
519test_write_rockspec() { $luarocks write_rockspec git://github.com/keplerproject/luarocks; } 524test_write_rockspec() { $luarocks write_rockspec git://github.com/keplerproject/luarocks; }
525test_write_rockspec_name() { $luarocks write_rockspec luarocks git://github.com/keplerproject/luarocks; }
526test_write_rockspec_name_version() { $luarocks write_rockspec luarocks 7.8.9 git://github.com/keplerproject/luarocks; }
527test_write_rockspec_current_dir() { $luarocks write_rockspec; }
520test_write_rockspec_tag() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --tag=v2.3.0; } 528test_write_rockspec_tag() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --tag=v2.3.0; }
521test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; } 529test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; }
522test_write_rockspec_format() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --rockspec-format=1.1 --lua-version=5.1,5.2; } 530test_write_rockspec_format() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --rockspec-format=1.1 --lua-version=5.1,5.2; }
@@ -558,8 +566,12 @@ test_doc_list() { $luarocks install luacov; $luarocks doc luacov --list; }
558test_doc_local() { $luarocks install luacov; $luarocks doc luacov --local; } 566test_doc_local() { $luarocks install luacov; $luarocks doc luacov --local; }
559test_doc_porcelain() { $luarocks install luacov; $luarocks doc luacov --porcelain; } 567test_doc_porcelain() { $luarocks install luacov; $luarocks doc luacov --porcelain; }
560 568
561# Driver ######################################### 569# Tests for https://github.com/keplerproject/luarocks/pull/552
570test_install_break_dependencies_warning() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install say ${old_version_say}; }
571test_install_break_dependencies_force() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install --force say ${old_version_say}; }
572test_install_break_dependencies_forcefast() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install --force-fast say ${old_version_say}; }
562 573
574# Driver #########################################
563run_tests() { 575run_tests() {
564 grep "^test_$1.*(" < $testing_dir/testing.sh | cut -d'(' -f1 | while read test 576 grep "^test_$1.*(" < $testing_dir/testing.sh | cut -d'(' -f1 | while read test
565 do 577 do