diff options
| author | Peter Melnichenko <mpeterval@gmail.com> | 2016-06-13 12:10:59 +0300 |
|---|---|---|
| committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-06-13 12:29:06 +0300 |
| commit | 9fa380490931813a153b1cb079c2b3c21092bacf (patch) | |
| tree | cb0cafa825a7815810d13945d20808cc43869c03 /test | |
| parent | 0bed8bc1cf789ec3539469ed7d6ec437446b1b95 (diff) | |
| parent | f75295ee52bc2c335d12e82282d0f92a419a82d1 (diff) | |
| download | luarocks-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.lua | 21 | ||||
| -rwxr-xr-x | test/testing.sh | 19 |
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 | |||
| 213 | version_cprint=0.1 | 213 | version_cprint=0.1 |
| 214 | verrev_cprint=0.1-2 | 214 | verrev_cprint=0.1-2 |
| 215 | 215 | ||
| 216 | new_version_say=1.2-1 | ||
| 217 | old_version_say=1.0-1 | ||
| 218 | |||
| 216 | version_luacov=0.11.0 | 219 | version_luacov=0.11.0 |
| 217 | verrev_luacov=${version_luacov}-1 | 220 | verrev_luacov=${version_luacov}-1 |
| 218 | version_lxsh=0.8.6 | 221 | version_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; } | |||
| 392 | fail_upload_noarg() { $luarocks upload; } | 398 | fail_upload_noarg() { $luarocks upload; } |
| 393 | fail_remove_noarg() { $luarocks remove; } | 399 | fail_remove_noarg() { $luarocks remove; } |
| 394 | fail_doc_noarg() { $luarocks doc; } | 400 | fail_doc_noarg() { $luarocks doc; } |
| 395 | fail_new_version_noarg() { $luarocks new_version; } | ||
| 396 | fail_write_rockspec_noarg() { $luarocks write_rockspec; } | ||
| 397 | 401 | ||
| 398 | fail_build_invalid() { $luarocks build invalid; } | 402 | fail_build_invalid() { $luarocks build invalid; } |
| 399 | fail_download_invalid() { $luarocks download invalid; } | 403 | fail_download_invalid() { $luarocks download invalid; } |
| @@ -476,6 +480,7 @@ test_make_pack_binary_rock() { rm -rf ./lxsh-${verrev_lxsh} && $luarocks downlo | |||
| 476 | test_new_version() { $luarocks download --rockspec luacov ${version_luacov} && $luarocks new_version ./luacov-${version_luacov}-1.rockspec 0.2 && rm ./luacov-0.*; } | 480 | test_new_version() { $luarocks download --rockspec luacov ${version_luacov} && $luarocks new_version ./luacov-${version_luacov}-1.rockspec 0.2 && rm ./luacov-0.*; } |
| 477 | test_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-*; } | 481 | test_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-*; } |
| 478 | test_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; } | 482 | test_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; } |
| 483 | test_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 | ||
| 480 | test_pack() { $luarocks list && $luarocks pack luacov && rm ./luacov-*.rock; } | 485 | test_pack() { $luarocks list && $luarocks pack luacov && rm ./luacov-*.rock; } |
| 481 | test_pack_src() { $luarocks install $luasec && $luarocks download --rockspec luasocket && $luarocks pack ./luasocket-${verrev_luasocket}.rockspec && rm ./luasocket-${version_luasocket}-*.rock; } | 486 | test_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 | ||
| 494 | test_remove() { $luarocks build abelhas ${version_abelhas} && $luarocks remove abelhas ${version_abelhas}; } | 499 | test_remove() { $luarocks build abelhas ${version_abelhas} && $luarocks remove abelhas ${version_abelhas}; } |
| 495 | test_remove_force() { need_luasocket; $luarocks build lualogging && $luarocks remove --force luasocket; } | 500 | test_remove_force() { need_luasocket; $luarocks build lualogging && $luarocks remove --force luasocket; } |
| 501 | test_remove_force_fast() { need_luasocket; $luarocks build lualogging && $luarocks remove --force-fast luasocket; } | ||
| 496 | fail_remove_deps() { need_luasocket; $luarocks build lualogging && $luarocks remove luasocket; } | 502 | fail_remove_deps() { need_luasocket; $luarocks build lualogging && $luarocks remove luasocket; } |
| 497 | fail_remove_missing() { $luarocks remove missing_rock; } | 503 | fail_remove_missing() { $luarocks remove missing_rock; } |
| 498 | fail_remove_invalid_name() { $luarocks remove invalid.rock; } | 504 | fail_remove_invalid_name() { $luarocks remove invalid.rock; } |
| @@ -551,6 +557,9 @@ test_deps_mode_make_order() { $luarocks build --tree="$testing_sys_tree" lpeg && | |||
| 551 | test_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}; } | 557 | test_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 | ||
| 553 | test_write_rockspec() { $luarocks write_rockspec git://github.com/keplerproject/luarocks; } | 559 | test_write_rockspec() { $luarocks write_rockspec git://github.com/keplerproject/luarocks; } |
| 560 | test_write_rockspec_name() { $luarocks write_rockspec luarocks git://github.com/keplerproject/luarocks; } | ||
| 561 | test_write_rockspec_name_version() { $luarocks write_rockspec luarocks 7.8.9 git://github.com/keplerproject/luarocks; } | ||
| 562 | test_write_rockspec_current_dir() { $luarocks write_rockspec; } | ||
| 554 | test_write_rockspec_tag() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --tag=v2.3.0; } | 563 | test_write_rockspec_tag() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --tag=v2.3.0; } |
| 555 | test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; } | 564 | test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; } |
| 556 | test_write_rockspec_format() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --rockspec-format=1.1 --lua-version=5.1,5.2; } | 565 | test_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; } | |||
| 605 | test_doc_local() { $luarocks install luacov; $luarocks doc luacov --local; } | 614 | test_doc_local() { $luarocks install luacov; $luarocks doc luacov --local; } |
| 606 | test_doc_porcelain() { $luarocks install luacov; $luarocks doc luacov --porcelain; } | 615 | test_doc_porcelain() { $luarocks install luacov; $luarocks doc luacov --porcelain; } |
| 607 | 616 | ||
| 608 | # Driver ######################################### | 617 | # Tests for https://github.com/keplerproject/luarocks/pull/552 |
| 618 | test_install_break_dependencies_warning() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install say ${old_version_say}; } | ||
| 619 | test_install_break_dependencies_force() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install --force say ${old_version_say}; } | ||
| 620 | test_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 ######################################### | ||
| 610 | run_tests() { | 623 | run_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 |
