From 2f3c8648289bb4e22eee5f8ff8d27afca6592fa4 Mon Sep 17 00:00:00 2001 From: roboo Date: Sun, 21 Aug 2016 21:50:38 +0200 Subject: Windows and appveyor support for tests --- spec/install_spec.lua | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) (limited to 'spec/install_spec.lua') diff --git a/spec/install_spec.lua b/spec/install_spec.lua index bd480c21..2b6cb77f 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua @@ -12,8 +12,8 @@ local extra_rocks = { "/lpeg-0.12-1.src.rock", "/luasec-0.6-1.rockspec", "/luassert-1.7.0-1.src.rock", - "/luasocket-3.0rc1-1.src.rock", - "/luasocket-3.0rc1-1.rockspec", + "/luasocket-3.0rc1-2.src.rock", + "/luasocket-3.0rc1-2.rockspec", "/lxsh-0.8.6-2.src.rock", "/lxsh-0.8.6-2.rockspec", "/say-1.2-1.src.rock", @@ -44,8 +44,8 @@ describe("LuaRocks install tests #blackbox #b_install", function() assert.is_false(run.luarocks_bool("install \"invalid.rock\" ")) end) - it("LuaRocks install with local flag as root", function() - assert.is_false(run.luarocks_bool("install --local luasocket", { USER = "root" } )) + it("LuaRocks install with local flag as root #unix", function() + assert.is_false(run.luarocks_bool("install --local luasocket ", { USER = "root" } )) end) it("LuaRocks install not a zip file", function() @@ -66,14 +66,22 @@ describe("LuaRocks install tests #blackbox #b_install", function() end) it("LuaRocks install luasec and show luasocket (dependency)", function() - assert.is_true(run.luarocks_bool("install luasec")) + if test_env.APPVEYOR then + assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.APPVEYOR_OPENSSL))) + else + assert.is_true(run.luarocks_bool(test_env.quiet("install luasec"))) + end assert.is_true(run.luarocks_bool("show luasocket")) end) end) describe("LuaRocks install - more complex tests", function() it('LuaRocks install luasec with skipping dependency checks', function() - run.luarocks_bool(test_env.quiet(" install luasec --nodeps")) + if test_env.APPVEYOR then + assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.APPVEYOR_OPENSSL .. " --nodeps"))) + else + assert.is_true(run.luarocks_bool(test_env.quiet("install luasec --nodeps"))) + end assert.is_true(run.luarocks_bool(test_env.quiet("show luasec"))) if env_variables.TYPE_TEST_ENV == "minimal" then assert.is_false(run.luarocks_bool(test_env.quiet("show luasocket"))) @@ -83,17 +91,17 @@ describe("LuaRocks install tests #blackbox #b_install", function() end) it("LuaRocks install only-deps of luasocket packed rock", function() - assert.is_true(run.luarocks_bool(test_env.quiet("build --pack-binary-rock luasocket 3.0rc1-1"))) - local output = run.luarocks("install --only-deps " .. "luasocket-3.0rc1-1." .. test_env.platform .. ".rock") - assert.are.same(output, "Successfully installed dependencies for luasocket 3.0rc1-1") - assert.is_true(os.remove("luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) + assert.is_true(run.luarocks_bool(test_env.quiet("build --pack-binary-rock luasocket 3.0rc1-2"))) + local output = run.luarocks("install --only-deps " .. "luasocket-3.0rc1-2." .. test_env.platform .. ".rock") + assert.are.same(output, "Successfully installed dependencies for luasocket 3.0rc1-2") + assert.is_true(os.remove("luasocket-3.0rc1-2." .. test_env.platform .. ".rock")) end) it("LuaRocks install reinstall", function() - assert.is_true(run.luarocks_bool(test_env.quiet("build --pack-binary-rock luasocket 3.0rc1-1"))) - assert.is_true(run.luarocks_bool("install " .. "luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) - assert.is_true(run.luarocks_bool("install --deps-mode=none " .. "luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) - assert.is_true(os.remove("luasocket-3.0rc1-1." .. test_env.platform .. ".rock")) + assert.is_true(run.luarocks_bool(test_env.quiet("build --pack-binary-rock luasocket 3.0rc1-2"))) + assert.is_true(run.luarocks_bool("install " .. "luasocket-3.0rc1-2." .. test_env.platform .. ".rock")) + assert.is_true(run.luarocks_bool("install --deps-mode=none " .. "luasocket-3.0rc1-2." .. test_env.platform .. ".rock")) + assert.is_true(os.remove("luasocket-3.0rc1-2." .. test_env.platform .. ".rock")) end) it("LuaRocks install binary rock of cprint", function() -- cgit v1.2.3-55-g6feb