From 8915604a681c997166dbb163fc6e8a0e4e1de1fe Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Tue, 10 May 2016 20:42:12 +0300 Subject: Rename broken --force=fast to --force-fast --- test/testing.sh | 1 + 1 file changed, 1 insertion(+) (limited to 'test') diff --git a/test/testing.sh b/test/testing.sh index 305168c8..5269e42a 100755 --- a/test/testing.sh +++ b/test/testing.sh @@ -458,6 +458,7 @@ test_purge_oldversions() { $luarocks purge --old-versions --tree="$testing_sys_t test_remove() { $luarocks build abelhas ${version_abelhas} && $luarocks remove abelhas ${version_abelhas}; } test_remove_force() { need_luasocket; $luarocks build lualogging && $luarocks remove --force luasocket; } +test_remove_force_fast() { need_luasocket; $luarocks build lualogging && $luarocks remove --force-fast luasocket; } fail_remove_deps() { need_luasocket; $luarocks build lualogging && $luarocks remove luasocket; } fail_remove_missing() { $luarocks remove missing_rock; } fail_remove_invalid_name() { $luarocks remove invalid.rock; } -- cgit v1.2.3-55-g6feb From 4ac36ce3bc97d476e3f8d2a524099c38b5a0ab75 Mon Sep 17 00:00:00 2001 From: roboo Date: Tue, 17 May 2016 00:27:27 +0200 Subject: Added tests for new install functionality --- test/testing.lua | 21 ++++++++++++++++++++- test/testing.sh | 12 +++++++++++- 2 files changed, 31 insertions(+), 2 deletions(-) (limited to 'test') 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 = { and assert("lua-compat-5.2" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2.tar.bz2")) and assert("parser.moon" == fetch.url_to_base_dir("git://github.com/Cirru/parser.moon")) and assert("v0.3" == fetch.url_to_base_dir("https://github.com/hishamhm/lua-compat-5.2/archive/v0.3")) + end, + + -- Tests for https://github.com/keplerproject/luarocks/issues/552 + test_install_break_dependencies_warning = function() + need_luasocket() + return run "$luarocks install say ${new_version_say}" + and run "$luarocks install luassert" + and run "$luarocks install say ${old_version_say}" + end, + test_install_break_dependencies_force = function() + need_luasocket() + return run "$luarocks install say ${new_version_say}" + and run "$luarocks install luassert" + and run "$luarocks install --force say ${old_version_say}" + end, + test_install_break_dependencies_force = function() + need_luasocket() + return run "$luarocks install say ${new_version_say}" + and run "$luarocks install luassert" + and run "$luarocks install --force-fast say ${old_version_say}" end - } 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 version_cprint=0.1 verrev_cprint=0.1-2 +new_version_say=1.2-1 +old_version_say=1.0-1 + version_luacov=0.11.0 verrev_luacov=${version_luacov}-1 version_lxsh=0.8.6 @@ -260,6 +263,9 @@ mkdir -p "$testing_server" get "$luarocks_repo/lua-path-0.2.3-1.src.rock" get "$luarocks_repo/lua-cjson-2.1.0-1.src.rock" get "$luarocks_repo/luacov-coveralls-0.1.1-1.src.rock" + get "$luarocks_repo/say-1.2-1.src.rock" + get "$luarocks_repo/say-1.0-1.src.rock" + get "$luarocks_repo/luassert-1.7.0-1.src.rock" ) $luarocks_admin_nocov make_manifest "$testing_server" @@ -558,8 +564,12 @@ test_doc_list() { $luarocks install luacov; $luarocks doc luacov --list; } test_doc_local() { $luarocks install luacov; $luarocks doc luacov --local; } test_doc_porcelain() { $luarocks install luacov; $luarocks doc luacov --porcelain; } -# Driver ######################################### +# Tests for https://github.com/keplerproject/luarocks/pull/552 +test_install_break_dependencies_warning() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install say ${old_version_say}; } +test_install_break_dependencies_force() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install --force say ${old_version_say}; } +test_install_break_dependencies_forcefast() { need_luasocket; $luarocks install say ${new_version_say} && $luarocks install luassert && $luarocks install --force-fast say ${old_version_say}; } +# Driver ######################################### run_tests() { grep "^test_$1.*(" < $testing_dir/testing.sh | cut -d'(' -f1 | while read test do -- cgit v1.2.3-55-g6feb From 3e29a935df047976cff9e1f232c716b55fdcde69 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Sun, 22 May 2016 19:04:45 +0300 Subject: Update tests for `luarocks write-rockspec` --- test/testing.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/testing.sh b/test/testing.sh index 4f1b0b87..f56f2aa9 100755 --- a/test/testing.sh +++ b/test/testing.sh @@ -364,7 +364,6 @@ fail_upload_noarg() { $luarocks upload; } fail_remove_noarg() { $luarocks remove; } fail_doc_noarg() { $luarocks doc; } fail_new_version_noarg() { $luarocks new_version; } -fail_write_rockspec_noarg() { $luarocks write_rockspec; } fail_build_invalid() { $luarocks build invalid; } fail_download_invalid() { $luarocks download invalid; } @@ -523,6 +522,9 @@ test_deps_mode_make_order() { $luarocks build --tree="$testing_sys_tree" lpeg && 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}; } test_write_rockspec() { $luarocks write_rockspec git://github.com/keplerproject/luarocks; } +test_write_rockspec_name() { $luarocks write_rockspec luarocks git://github.com/keplerproject/luarocks; } +test_write_rockspec_name_version() { $luarocks write_rockspec luarocks 7.8.9 git://github.com/keplerproject/luarocks; } +test_write_rockspec_current_dir() { $luarocks write_rockspec; } test_write_rockspec_tag() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --tag=v2.3.0; } test_write_rockspec_lib() { $luarocks write_rockspec git://github.com/mbalmer/luafcgi --lib=fcgi --license="3-clause BSD" --lua-version=5.1,5.2; } test_write_rockspec_format() { $luarocks write_rockspec git://github.com/keplerproject/luarocks --rockspec-format=1.1 --lua-version=5.1,5.2; } -- cgit v1.2.3-55-g6feb From 22c8993ebe5f509ee55b8af6b7a8be147b3884e6 Mon Sep 17 00:00:00 2001 From: Peter Melnichenko Date: Wed, 25 May 2016 11:17:14 +0300 Subject: luarocks new-version: make rockspec arg optional Infer it same way `luarocks make` does. --- src/luarocks/new_version.lua | 13 +++++++++---- test/testing.sh | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/src/luarocks/new_version.lua b/src/luarocks/new_version.lua index 6969d4b2..3382b85c 100644 --- a/src/luarocks/new_version.lua +++ b/src/luarocks/new_version.lua @@ -11,13 +11,14 @@ local fs = require("luarocks.fs") local type_check = require("luarocks.type_check") new_version.help_summary = "Auto-write a rockspec for a new version of a rock." -new_version.help_arguments = "[--tag=] {|} [] []" +new_version.help_arguments = "[--tag=] [|] [] []" new_version.help = [[ This is a utility function that writes a new rockspec, updating data from a previous one. If a package name is given, it downloads the latest rockspec from the -default server. If a rockspec is given, it uses it instead. +default server. If a rockspec is given, it uses it instead. If no argument +is given, it looks for a rockspec same way 'luarocks make' does. If the version number is not given and tag is passed using --tag, it is used as the version, with 'v' removed from beginning. @@ -125,12 +126,16 @@ end function new_version.run(...) local flags, input, version, url = util.parse_flags(...) if not input then - return nil, "Missing argument: expected package or rockspec. "..util.see_help("new_version") + local err + input, err = util.get_default_rockspec() + if not input then + return nil, err + end end assert(type(input) == "string") local filename = input - if not input:match(".rockspec$") then + if not input:match("rockspec$") then local err filename, err = download.download("rockspec", input) if not filename then diff --git a/test/testing.sh b/test/testing.sh index f56f2aa9..cb10441c 100755 --- a/test/testing.sh +++ b/test/testing.sh @@ -363,7 +363,6 @@ fail_unpack_noarg() { $luarocks unpack; } fail_upload_noarg() { $luarocks upload; } fail_remove_noarg() { $luarocks remove; } fail_doc_noarg() { $luarocks doc; } -fail_new_version_noarg() { $luarocks new_version; } fail_build_invalid() { $luarocks build invalid; } fail_download_invalid() { $luarocks download invalid; } @@ -446,6 +445,7 @@ test_make_pack_binary_rock() { rm -rf ./lxsh-${verrev_lxsh} && $luarocks downlo test_new_version() { $luarocks download --rockspec luacov ${version_luacov} && $luarocks new_version ./luacov-${version_luacov}-1.rockspec 0.2 && rm ./luacov-0.*; } 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-*; } 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; } +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; } test_pack() { $luarocks list && $luarocks pack luacov && rm ./luacov-*.rock; } test_pack_src() { $luarocks install $luasec && $luarocks download --rockspec luasocket && $luarocks pack ./luasocket-${verrev_luasocket}.rockspec && rm ./luasocket-${version_luasocket}-*.rock; } -- cgit v1.2.3-55-g6feb