aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-06-13 12:10:59 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-06-13 12:29:06 +0300
commit9fa380490931813a153b1cb079c2b3c21092bacf (patch)
treecb0cafa825a7815810d13945d20808cc43869c03 /test
parent0bed8bc1cf789ec3539469ed7d6ec437446b1b95 (diff)
parentf75295ee52bc2c335d12e82282d0f92a419a82d1 (diff)
downloadluarocks-9fa380490931813a153b1cb079c2b3c21092bacf.tar.gz
luarocks-9fa380490931813a153b1cb079c2b3c21092bacf.tar.bz2
luarocks-9fa380490931813a153b1cb079c2b3c21092bacf.zip
Merge branch 'master' into luarocks-3
Diffstat (limited to 'test')
-rw-r--r--test/testing.lua21
-rwxr-xr-xtest/testing.sh19
2 files changed, 36 insertions, 4 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 dbc1249e..e4b5d8c2 100755
--- a/test/testing.sh
+++ b/test/testing.sh
@@ -213,6 +213,9 @@ srcdir_luasocket=luasocket-3.0-rc1
213version_cprint=0.1 213version_cprint=0.1
214verrev_cprint=0.1-2 214verrev_cprint=0.1-2
215 215
216new_version_say=1.2-1
217old_version_say=1.0-1
218
216version_luacov=0.11.0 219version_luacov=0.11.0
217verrev_luacov=${version_luacov}-1 220verrev_luacov=${version_luacov}-1
218version_lxsh=0.8.6 221version_lxsh=0.8.6
@@ -295,6 +298,9 @@ mkdir -p "$testing_server"
295 get "$luarocks_repo/lua-path-0.2.3-1.src.rock" 298 get "$luarocks_repo/lua-path-0.2.3-1.src.rock"
296 get "$luarocks_repo/lua-cjson-2.1.0-1.src.rock" 299 get "$luarocks_repo/lua-cjson-2.1.0-1.src.rock"
297 get "$luarocks_repo/luacov-coveralls-0.1.1-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"
298) 304)
299$luarocks_admin_nocov make_manifest "$testing_server" 305$luarocks_admin_nocov make_manifest "$testing_server"
300 306
@@ -392,8 +398,6 @@ fail_unpack_noarg() { $luarocks unpack; }
392fail_upload_noarg() { $luarocks upload; } 398fail_upload_noarg() { $luarocks upload; }
393fail_remove_noarg() { $luarocks remove; } 399fail_remove_noarg() { $luarocks remove; }
394fail_doc_noarg() { $luarocks doc; } 400fail_doc_noarg() { $luarocks doc; }
395fail_new_version_noarg() { $luarocks new_version; }
396fail_write_rockspec_noarg() { $luarocks write_rockspec; }
397 401
398fail_build_invalid() { $luarocks build invalid; } 402fail_build_invalid() { $luarocks build invalid; }
399fail_download_invalid() { $luarocks download invalid; } 403fail_download_invalid() { $luarocks download invalid; }
@@ -476,6 +480,7 @@ test_make_pack_binary_rock() { rm -rf ./lxsh-${verrev_lxsh} && $luarocks downlo
476test_new_version() { $luarocks download --rockspec luacov ${version_luacov} && $luarocks new_version ./luacov-${version_luacov}-1.rockspec 0.2 && rm ./luacov-0.*; } 480test_new_version() { $luarocks download --rockspec luacov ${version_luacov} && $luarocks new_version ./luacov-${version_luacov}-1.rockspec 0.2 && rm ./luacov-0.*; }
477test_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-*; } 481test_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-*; }
478test_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; } 482test_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; }
483test_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; }
479 484
480test_pack() { $luarocks list && $luarocks pack luacov && rm ./luacov-*.rock; } 485test_pack() { $luarocks list && $luarocks pack luacov && rm ./luacov-*.rock; }
481test_pack_src() { $luarocks install $luasec && $luarocks download --rockspec luasocket && $luarocks pack ./luasocket-${verrev_luasocket}.rockspec && rm ./luasocket-${version_luasocket}-*.rock; } 486test_pack_src() { $luarocks install $luasec && $luarocks download --rockspec luasocket && $luarocks pack ./luasocket-${verrev_luasocket}.rockspec && rm ./luasocket-${version_luasocket}-*.rock; }
@@ -493,6 +498,7 @@ test_purge_oldversions() { $luarocks purge --old-versions --tree="$testing_sys_t
493 498
494test_remove() { $luarocks build abelhas ${version_abelhas} && $luarocks remove abelhas ${version_abelhas}; } 499test_remove() { $luarocks build abelhas ${version_abelhas} && $luarocks remove abelhas ${version_abelhas}; }
495test_remove_force() { need_luasocket; $luarocks build lualogging && $luarocks remove --force luasocket; } 500test_remove_force() { need_luasocket; $luarocks build lualogging && $luarocks remove --force luasocket; }
501test_remove_force_fast() { need_luasocket; $luarocks build lualogging && $luarocks remove --force-fast luasocket; }
496fail_remove_deps() { need_luasocket; $luarocks build lualogging && $luarocks remove luasocket; } 502fail_remove_deps() { need_luasocket; $luarocks build lualogging && $luarocks remove luasocket; }
497fail_remove_missing() { $luarocks remove missing_rock; } 503fail_remove_missing() { $luarocks remove missing_rock; }
498fail_remove_invalid_name() { $luarocks remove invalid.rock; } 504fail_remove_invalid_name() { $luarocks remove invalid.rock; }
@@ -551,6 +557,9 @@ test_deps_mode_make_order() { $luarocks build --tree="$testing_sys_tree" lpeg &&
551test_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}; } 557test_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}; }
552 558
553test_write_rockspec() { $luarocks write_rockspec git://github.com/keplerproject/luarocks; } 559test_write_rockspec() { $luarocks write_rockspec git://github.com/keplerproject/luarocks; }
560test_write_rockspec_name() { $luarocks write_rockspec luarocks git://github.com/keplerproject/luarocks; }
561test_write_rockspec_name_version() { $luarocks write_rockspec luarocks 7.8.9 git://github.com/keplerproject/luarocks; }
562test_write_rockspec_current_dir() { $luarocks write_rockspec; }
554test_write_rockspec_tag() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --tag=v2.3.0; } 563test_write_rockspec_tag() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --tag=v2.3.0; }
555test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; } 564test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; }
556test_write_rockspec_format() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --rockspec-format=1.1 --lua-version=5.1,5.2; } 565test_write_rockspec_format() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --rockspec-format=1.1 --lua-version=5.1,5.2; }
@@ -605,8 +614,12 @@ test_doc_list() { $luarocks install luacov; $luarocks doc luacov --list; }
605test_doc_local() { $luarocks install luacov; $luarocks doc luacov --local; } 614test_doc_local() { $luarocks install luacov; $luarocks doc luacov --local; }
606test_doc_porcelain() { $luarocks install luacov; $luarocks doc luacov --porcelain; } 615test_doc_porcelain() { $luarocks install luacov; $luarocks doc luacov --porcelain; }
607 616
608# Driver ######################################### 617# Tests for https://github.com/keplerproject/luarocks/pull/552
618test_install_break_dependencies_warning() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install say ${old_version_say}; }
619test_install_break_dependencies_force() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install --force say ${old_version_say}; }
620test_install_break_dependencies_forcefast() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install --force-fast say ${old_version_say}; }
609 621
622# Driver #########################################
610run_tests() { 623run_tests() {
611 grep "^test_$1.*(" < $testing_dir/testing.sh | cut -d'(' -f1 | while read test 624 grep "^test_$1.*(" < $testing_dir/testing.sh | cut -d'(' -f1 | while read test
612 do 625 do