diff options
| author | roboo <robo.karasek@gmail.com> | 2016-05-17 00:27:27 +0200 |
|---|---|---|
| committer | roboo <robo.karasek@gmail.com> | 2016-05-17 00:27:27 +0200 |
| commit | 4ac36ce3bc97d476e3f8d2a524099c38b5a0ab75 (patch) | |
| tree | f08f5efa0d7d53fead663d6e213e41bb91cbadc8 | |
| parent | 699abc334895b5e737976d7aa6c1982a692d623b (diff) | |
| download | luarocks-4ac36ce3bc97d476e3f8d2a524099c38b5a0ab75.tar.gz luarocks-4ac36ce3bc97d476e3f8d2a524099c38b5a0ab75.tar.bz2 luarocks-4ac36ce3bc97d476e3f8d2a524099c38b5a0ab75.zip | |
Added tests for new install functionality
| -rw-r--r-- | test/testing.lua | 21 | ||||
| -rwxr-xr-x | test/testing.sh | 12 |
2 files changed, 31 insertions, 2 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..4f1b0b87 100755 --- a/test/testing.sh +++ b/test/testing.sh | |||
| @@ -179,6 +179,9 @@ srcdir_luasocket=luasocket-3.0-rc1 | |||
| 179 | version_cprint=0.1 | 179 | version_cprint=0.1 |
| 180 | verrev_cprint=0.1-2 | 180 | verrev_cprint=0.1-2 |
| 181 | 181 | ||
| 182 | new_version_say=1.2-1 | ||
| 183 | old_version_say=1.0-1 | ||
| 184 | |||
| 182 | version_luacov=0.11.0 | 185 | version_luacov=0.11.0 |
| 183 | verrev_luacov=${version_luacov}-1 | 186 | verrev_luacov=${version_luacov}-1 |
| 184 | version_lxsh=0.8.6 | 187 | version_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 | ||
| @@ -558,8 +564,12 @@ test_doc_list() { $luarocks install luacov; $luarocks doc luacov --list; } | |||
| 558 | test_doc_local() { $luarocks install luacov; $luarocks doc luacov --local; } | 564 | test_doc_local() { $luarocks install luacov; $luarocks doc luacov --local; } |
| 559 | test_doc_porcelain() { $luarocks install luacov; $luarocks doc luacov --porcelain; } | 565 | test_doc_porcelain() { $luarocks install luacov; $luarocks doc luacov --porcelain; } |
| 560 | 566 | ||
| 561 | # Driver ######################################### | 567 | # Tests for https://github.com/keplerproject/luarocks/pull/552 |
| 568 | test_install_break_dependencies_warning() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install say ${old_version_say}; } | ||
| 569 | test_install_break_dependencies_force() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install --force say ${old_version_say}; } | ||
| 570 | test_install_break_dependencies_forcefast() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install --force-fast say ${old_version_say}; } | ||
| 562 | 571 | ||
| 572 | # Driver ######################################### | ||
| 563 | run_tests() { | 573 | run_tests() { |
| 564 | grep "^test_$1.*(" < $testing_dir/testing.sh | cut -d'(' -f1 | while read test | 574 | grep "^test_$1.*(" < $testing_dir/testing.sh | cut -d'(' -f1 | while read test |
| 565 | do | 575 | do |
