From 6b350de4daaccba8b142c5db0d8fb8fabaa1649b Mon Sep 17 00:00:00 2001 From: Ignacio BurgueƱo Date: Tue, 14 Apr 2015 12:34:54 -0300 Subject: Adds --only-deps flag to install command Introduces new function in 'install' module to only install the dependencies of a rock. Also adds the tests to the wip Lua test driver. --- test/testing.lua | 12 ++++++++++++ test/testing.sh | 22 ++++------------------ 2 files changed, 16 insertions(+), 18 deletions(-) (limited to 'test') diff --git a/test/testing.lua b/test/testing.lua index 376d6e9a..45ee941a 100644 --- a/test/testing.lua +++ b/test/testing.lua @@ -140,6 +140,18 @@ local tests = { and rm "./validate-args-${verrev_validate_args}.rockspec" end, test_build_supported_platforms = function() return run "$luarocks build lpty" end, + test_build_only_deps_rockspec = function() + return run "$luarocks download --rockspec lxsh ${verrev_lxsh}" + and run "$luarocks build ./lxsh-${verrev_lxsh}.rockspec --only-deps" + and run "$luarocks show lxsh; [ $? -ne 0 ]; };" + end, + test_build_only_deps_src_rock = function() + return run "$luarocks download --source lxsh ${verrev_lxsh}" + and run "$luarocks build ./lxsh-${verrev_lxsh}.src.rock --only-deps" + and run "$luarocks show lxsh; [ $? -ne 0 ]; };" + end, + test_build_only_deps = function() return run "$luarocks build luasec --only-deps" and run "$luarocks show luasec; [ $? -ne 0 ]; };" end, + test_install_only_deps = function() return run "$luarocks install lxsh ${verrev_lxsh} --only-deps" and run "$luarocks show lxsh; [ $? -ne 0 ]; };" end, fail_build_missing_external = function() return run '$luarocks build "$testing_dir/testfiles/missing_external-0.1-1.rockspec" INEXISTENT_INCDIR="/invalid/dir"' end, fail_build_invalidpatch = function() need_luasocket() diff --git a/test/testing.sh b/test/testing.sh index 78e60a76..7f0a4ae0 100755 --- a/test/testing.sh +++ b/test/testing.sh @@ -387,24 +387,10 @@ test_build_install_bin() { $luarocks build luarepl; } test_build_nohttps() { need_luasocket; $luarocks download --rockspec validate-args ${verrev_validate_args} && $luarocks build ./validate-args-${version_validate_args}-1.rockspec && rm ./validate-args-${version_validate_args}-1.rockspec; } test_build_https() { need_luasocket; $luarocks download --rockspec validate-args ${verrev_validate_args} && $luarocks install $luasec && $luarocks build ./validate-args-${verrev_validate_args}.rockspec && rm ./validate-args-${verrev_validate_args}.rockspec; } test_build_supported_platforms() { $luarocks build lpty; } -test_build_only_deps_rockspec() { $luarocks download --rockspec lxsh ${verrev_lxsh} ; $luarocks build ./lxsh-${verrev_lxsh}.rockspec --only-deps; $luarocks show lxsh; - if [ $? -ne 0 ] - then return 0; - fi; - return 1; -} -test_build_only_deps_src_rock() { $luarocks download --source lxsh ${verrev_lxsh} ; $luarocks build ./lxsh-${verrev_lxsh}.src.rock --only-deps; $luarocks show lxsh; - if [ $? -ne 0 ] - then return 0; - fi; - return 1; -} -test_build_only_deps() { $luarocks build luasec --only-deps; $luarocks show luasec; - if [ $? -ne 0 ] - then return 0; - fi; - return 1; -} +test_build_only_deps_rockspec() { $luarocks download --rockspec lxsh ${verrev_lxsh} && $luarocks build ./lxsh-${verrev_lxsh}.rockspec --only-deps && { $luarocks show lxsh; [ $? -ne 0 ]; }; } +test_build_only_deps_src_rock() { $luarocks download --source lxsh ${verrev_lxsh} && $luarocks build ./lxsh-${verrev_lxsh}.src.rock --only-deps && { $luarocks show lxsh; [ $? -ne 0 ]; }; } +test_build_only_deps() { $luarocks build luasec --only-deps && { $luarocks show luasec; [ $? -ne 0 ]; }; } +test_install_only_deps() { $luarocks install lxsh ${verrev_lxsh} --only-deps && { $luarocks show lxsh; [ $? -ne 0 ]; }; } fail_build_missing_external() { $luarocks build "$testing_dir/testfiles/missing_external-0.1-1.rockspec" INEXISTENT_INCDIR="/invalid/dir"; } fail_build_invalidpatch() { need_luasocket; $luarocks build "$testing_dir/testfiles/invalid_patch-0.1-1.rockspec"; } -- cgit v1.2.3-55-g6feb