summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGeorge Roman <george.roman.99@gmail.com>2018-07-04 00:44:00 +0300
committerHisham Muhammad <hisham@gobolinux.org>2018-07-05 15:51:35 -0300
commit67a8c5c13f057163273c15dea73491a86f61c676 (patch)
tree55f470bec8e0b3ad76dd2dcd921d2eababf8a092 /spec
parent428391af63b4f95fffe829fb19ab7e0ad4c5bd5a (diff)
downloadluarocks-67a8c5c13f057163273c15dea73491a86f61c676.tar.gz
luarocks-67a8c5c13f057163273c15dea73491a86f61c676.tar.bz2
luarocks-67a8c5c13f057163273c15dea73491a86f61c676.zip
Tests: separate OPENSSL_DIRS into OPENSSL_INCDIR and OPENSSL_LIBDIR
Diffstat (limited to 'spec')
-rw-r--r--spec/build_spec.lua9
-rw-r--r--spec/install_spec.lua6
-rw-r--r--spec/upload_spec.lua7
-rw-r--r--spec/util/test_env.lua18
4 files changed, 30 insertions, 10 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index 74efccd5..c7fd2a22 100644
--- a/spec/build_spec.lua
+++ b/spec/build_spec.lua
@@ -161,7 +161,8 @@ describe("LuaRocks build tests #integration", function()
161 end) 161 end)
162 162
163 it("LuaRocks build luasec with skipping dependency checks", function() 163 it("LuaRocks build luasec with skipping dependency checks", function()
164 assert.is_true(run.luarocks_bool("build luasec 0.6-1 " .. test_env.OPENSSL_DIRS .. " --nodeps")) 164 local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR
165 assert.is_true(run.luarocks_bool("build luasec 0.6-1 " .. openssl_dirs .. " --nodeps"))
165 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasec/0.6-1/luasec-0.6-1.rockspec")) 166 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasec/0.6-1/luasec-0.6-1.rockspec"))
166 end) 167 end)
167 168
@@ -221,7 +222,8 @@ describe("LuaRocks build tests #integration", function()
221 end 222 end
222 223
223 it("LuaRocks build luasec only deps", function() 224 it("LuaRocks build luasec only deps", function()
224 assert.is_true(run.luarocks_bool("build luasec " .. test_env.OPENSSL_DIRS .. " --only-deps")) 225 local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR
226 assert.is_true(run.luarocks_bool("build luasec " .. openssl_dirs .. " --only-deps"))
225 assert.is_false(run.luarocks_bool("show luasec")) 227 assert.is_false(run.luarocks_bool("show luasec"))
226 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasec/0.6-1/luasec-0.6-1.rockspec")) 228 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasec/0.6-1/luasec-0.6-1.rockspec"))
227 end) 229 end)
@@ -255,8 +257,9 @@ describe("LuaRocks build tests #integration", function()
255 end) 257 end)
256 258
257 it("LuaRocks build with https", function() 259 it("LuaRocks build with https", function()
260 local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR
258 assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) 261 assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1"))
259 assert.is_true(run.luarocks_bool("install luasec " .. test_env.OPENSSL_DIRS)) 262 assert.is_true(run.luarocks_bool("install luasec " .. openssl_dirs))
260 263
261 assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) 264 assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec"))
262 assert.is.truthy(run.luarocks("show validate-args")) 265 assert.is.truthy(run.luarocks("show validate-args"))
diff --git a/spec/install_spec.lua b/spec/install_spec.lua
index 431ca39d..f4d8a418 100644
--- a/spec/install_spec.lua
+++ b/spec/install_spec.lua
@@ -85,7 +85,8 @@ describe("luarocks install #integration", function()
85 end) 85 end)
86 86
87 it("installs a package with a dependency", function() 87 it("installs a package with a dependency", function()
88 assert.is_true(run.luarocks_bool("install luasec " .. test_env.OPENSSL_DIRS)) 88 local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR
89 assert.is_true(run.luarocks_bool("install luasec " .. openssl_dirs))
89 assert.is_true(run.luarocks_bool("show luasocket")) 90 assert.is_true(run.luarocks_bool("show luasocket"))
90 end) 91 end)
91 end) 92 end)
@@ -138,7 +139,8 @@ describe("luarocks install #integration", function()
138 139
139 describe("more complex tests", function() 140 describe("more complex tests", function()
140 it('luasec with skipping dependency checks', function() 141 it('luasec with skipping dependency checks', function()
141 assert.is_true(run.luarocks_bool("install luasec " .. test_env.OPENSSL_DIRS .. " --nodeps")) 142 local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR
143 assert.is_true(run.luarocks_bool("install luasec " .. openssl_dirs .. " --nodeps"))
142 assert.is_true(run.luarocks_bool("show luasec")) 144 assert.is_true(run.luarocks_bool("show luasec"))
143 if env_variables.TYPE_TEST_ENV == "minimal" then 145 if env_variables.TYPE_TEST_ENV == "minimal" then
144 assert.is_false(run.luarocks_bool(test_env.quiet("show luasocket"))) 146 assert.is_false(run.luarocks_bool(test_env.quiet("show luasocket")))
diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua
index abf2e43d..8290feca 100644
--- a/spec/upload_spec.lua
+++ b/spec/upload_spec.lua
@@ -37,10 +37,13 @@ describe("LuaRocks upload tests #integration", function()
37 after_each(test_env.mock_server_done) 37 after_each(test_env.mock_server_done)
38 38
39 it("LuaRocks upload rockspec with api-key", function() 39 it("LuaRocks upload rockspec with api-key", function()
40 assert.is_true(run.luarocks_bool("upload " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec " .. test_env.OPENSSL_DIRS .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testrun_dir .. "/luarocks_site.lua"})) 40 local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR
41 assert.is_true(run.luarocks_bool("upload " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec " .. openssl_dirs .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testrun_dir .. "/luarocks_site.lua"}))
41 end) 42 end)
43
42 it("LuaRocks upload rockspec with api-key and skip-pack", function() 44 it("LuaRocks upload rockspec with api-key and skip-pack", function()
43 assert.is_true(run.luarocks_bool("upload --skip-pack " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec " .. test_env.OPENSSL_DIRS .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testrun_dir .. "/luarocks_site.lua"})) 45 local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR
46 assert.is_true(run.luarocks_bool("upload --skip-pack " .. testing_paths.fixtures_dir .. "/a_rock-1.0-1.rockspec " .. openssl_dirs .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testrun_dir .. "/luarocks_site.lua"}))
44 end) 47 end)
45 end) 48 end)
46end) 49end)
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua
index 51893e83..db5cd203 100644
--- a/spec/util/test_env.lua
+++ b/spec/util/test_env.lua
@@ -208,7 +208,8 @@ end
208function test_env.set_args() 208function test_env.set_args()
209 -- if at least Lua/LuaJIT version argument was found on input start to parse other arguments to env. variables 209 -- if at least Lua/LuaJIT version argument was found on input start to parse other arguments to env. variables
210 test_env.TYPE_TEST_ENV = "minimal" 210 test_env.TYPE_TEST_ENV = "minimal"
211 test_env.OPENSSL_DIRS = "" 211 test_env.OPENSSL_INCDIR = ""
212 test_env.OPENSSL_LIBDIR = ""
212 test_env.RESET_ENV = true 213 test_env.RESET_ENV = true
213 214
214 for _, argument in ipairs(arg) do 215 for _, argument in ipairs(arg) do
@@ -224,7 +225,6 @@ function test_env.set_args()
224 test_env.TRAVIS = true 225 test_env.TRAVIS = true
225 elseif argument == "appveyor" then 226 elseif argument == "appveyor" then
226 test_env.APPVEYOR = true 227 test_env.APPVEYOR = true
227 test_env.OPENSSL_DIRS = "OPENSSL_LIBDIR=C:\\OpenSSL-Win32\\lib OPENSSL_INCDIR=C:\\OpenSSL-Win32\\include"
228 elseif argument:find("^os=") then 228 elseif argument:find("^os=") then
229 test_env.TEST_TARGET_OS = argument:match("^os=(.*)$") 229 test_env.TEST_TARGET_OS = argument:match("^os=(.*)$")
230 elseif argument == "mingw" then 230 elseif argument == "mingw" then
@@ -245,14 +245,26 @@ function test_env.set_args()
245 245
246 if package.config:sub(1,1) == "\\" then 246 if package.config:sub(1,1) == "\\" then
247 test_env.TEST_TARGET_OS = "windows" 247 test_env.TEST_TARGET_OS = "windows"
248 if test_env.APPVEYOR then
249 test_env.OPENSSL_INCDIR = "C:\\OpenSSL-Win32\\include"
250 test_env.OPENSSL_LIBDIR = "C:\\OpenSSL-Win32\\lib"
251 if test_env.MINGW then
252 test_env.OPENSSL_LIBDIR = "C:\\OpenSSL-Win32\\bin"
253 end
254 end
248 else 255 else
249 local system = execute_output("uname -s") 256 local system = execute_output("uname -s")
250 if system == "Linux" then 257 if system == "Linux" then
251 test_env.TEST_TARGET_OS = "linux" 258 test_env.TEST_TARGET_OS = "linux"
259 if test_env.TRAVIS then
260 test_env.OPENSSL_INCDIR = "/usr/include"
261 test_env.OPENSSL_LIBDIR = "/usr/lib/x86_64-linux-gnu"
262 end
252 elseif system == "Darwin" then 263 elseif system == "Darwin" then
253 test_env.TEST_TARGET_OS = "osx" 264 test_env.TEST_TARGET_OS = "osx"
254 if test_env.TRAVIS then 265 if test_env.TRAVIS then
255 test_env.OPENSSL_DIRS = "OPENSSL_LIBDIR=/usr/local/opt/openssl/lib OPENSSL_INCDIR=/usr/local/opt/openssl/include" 266 test_env.OPENSSL_INCDIR = "/usr/local/opt/openssl/include"
267 test_env.OPENSSL_LIBDIR = "/usr/local/opt/openssl/lib"
256 end 268 end
257 end 269 end
258 end 270 end