aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Melnichenko <mpeterval@gmail.com>2016-10-19 22:57:44 +0300
committerPeter Melnichenko <mpeterval@gmail.com>2016-10-19 23:05:45 +0300
commit9c239f33a929d300a45b74cc968fb34ffd526150 (patch)
treea0e6921b1c2a0b08e457504168ca49e31b18e25b
parent78e84d2c903e85ec620c08275519dac65e9cbf97 (diff)
downloadluarocks-9c239f33a929d300a45b74cc968fb34ffd526150.tar.gz
luarocks-9c239f33a929d300a45b74cc968fb34ffd526150.tar.bz2
luarocks-9c239f33a929d300a45b74cc968fb34ffd526150.zip
Add a test for #302
-rw-r--r--spec/install_spec.lua22
-rw-r--r--test/test_environment.lua1
2 files changed, 23 insertions, 0 deletions
diff --git a/spec/install_spec.lua b/spec/install_spec.lua
index 2bbf4221..f068af76 100644
--- a/spec/install_spec.lua
+++ b/spec/install_spec.lua
@@ -21,6 +21,8 @@ local extra_rocks = {
21 "/wsapi-1.6-1.src.rock", 21 "/wsapi-1.6-1.src.rock",
22 "/luafilesystem-1.6.3-2.src.rock", 22 "/luafilesystem-1.6.3-2.src.rock",
23 "/luafilesystem-1.6.3-1.src.rock", 23 "/luafilesystem-1.6.3-1.src.rock",
24 "/luacheck-0.7.3-1.src.rock",
25 "/luacheck-0.8.0-1.src.rock",
24} 26}
25 27
26describe("LuaRocks install tests #blackbox #b_install", function() 28describe("LuaRocks install tests #blackbox #b_install", function()
@@ -87,13 +89,33 @@ describe("LuaRocks install tests #blackbox #b_install", function()
87 it('LuaRocks install - handle versioned modules when installing another version with --keep #268', function() 89 it('LuaRocks install - handle versioned modules when installing another version with --keep #268', function()
88 assert.is_true(run.luarocks_bool("install luafilesystem")) 90 assert.is_true(run.luarocks_bool("install luafilesystem"))
89 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/lfs."..test_env.lib_extension)) 91 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/lfs."..test_env.lib_extension))
92
90 assert.is_true(run.luarocks_bool("install luafilesystem 1.6.3-1 --keep")) 93 assert.is_true(run.luarocks_bool("install luafilesystem 1.6.3-1 --keep"))
91 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/lfs."..test_env.lib_extension)) 94 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/lfs."..test_env.lib_extension))
92 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/luafilesystem_1_6_3_1-lfs."..test_env.lib_extension)) 95 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/luafilesystem_1_6_3_1-lfs."..test_env.lib_extension))
96
93 assert.is_true(run.luarocks_bool("install luafilesystem")) 97 assert.is_true(run.luarocks_bool("install luafilesystem"))
94 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/lfs."..test_env.lib_extension)) 98 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/lfs."..test_env.lib_extension))
95 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/luafilesystem_1_6_3_1-lfs."..test_env.lib_extension)) 99 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/lua/"..env_variables.LUA_VERSION.."/luafilesystem_1_6_3_1-lfs."..test_env.lib_extension))
96 end) 100 end)
101
102 it('LuaRocks install - handle versioned modules and commands from different files when upgrading #302', function()
103 assert.is_true(run.luarocks_bool("install luacheck 0.7.3 --deps-mode=none"))
104 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/luacheck.lua"))
105 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/bin/luacheck"..test_env.wrapper_extension))
106
107 assert.is_true(run.luarocks_bool("install luacheck 0.8.0 --deps-mode=none"))
108 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/luacheck/init.lua"))
109 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/bin/luacheck"..test_env.wrapper_extension))
110 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/luacheck_0_7_3_1-luacheck.lua"))
111 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/bin/luacheck_0_7_3_1-luacheck"..test_env.wrapper_extension))
112
113 assert.is_true(run.luarocks_bool("install luacheck 0.7.3 --keep --deps-mode=none"))
114 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/luacheck/init.lua"))
115 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/bin/luacheck"..test_env.wrapper_extension))
116 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/share/lua/"..env_variables.LUA_VERSION.."/luacheck_0_7_3_1-luacheck.lua"))
117 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/bin/luacheck_0_7_3_1-luacheck"..test_env.wrapper_extension))
118 end)
97 119
98 it("LuaRocks install only-deps of luasocket packed rock", function() 120 it("LuaRocks install only-deps of luasocket packed rock", function()
99 assert.is_true(run.luarocks_bool("build --pack-binary-rock luasocket 3.0rc1-2")) 121 assert.is_true(run.luarocks_bool("build --pack-binary-rock luasocket 3.0rc1-2"))
diff --git a/test/test_environment.lua b/test/test_environment.lua
index 1d0b0c32..196202df 100644
--- a/test/test_environment.lua
+++ b/test/test_environment.lua
@@ -515,6 +515,7 @@ function test_env.setup_specs(extra_rocks)
515 515
516 test_env.platform = execute_output(test_env.testing_paths.lua .. " -e \"print(require('luarocks.cfg').arch)\"", false, test_env.env_variables) 516 test_env.platform = execute_output(test_env.testing_paths.lua .. " -e \"print(require('luarocks.cfg').arch)\"", false, test_env.env_variables)
517 test_env.lib_extension = execute_output(test_env.testing_paths.lua .. " -e \"print(require('luarocks.cfg').lib_extension)\"", false, test_env.env_variables) 517 test_env.lib_extension = execute_output(test_env.testing_paths.lua .. " -e \"print(require('luarocks.cfg').lib_extension)\"", false, test_env.env_variables)
518 test_env.wrapper_extension = test_env.TEST_TARGET_OS == "windows" and ".bat" or ""
518 test_env.md5sums = create_md5sums(test_env.testing_paths) 519 test_env.md5sums = create_md5sums(test_env.testing_paths)
519 test_env.setup_done = true 520 test_env.setup_done = true
520 title("RUNNING TESTS") 521 title("RUNNING TESTS")