diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-13 22:51:33 -0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-18 11:24:07 -0300 |
| commit | 365c5a4bb52dead8d9f040d9857da448b194ada9 (patch) | |
| tree | 01855228e5577ba39ef876dfa4614e4be972bc56 | |
| parent | 491bf90358162dec2b4ca0a03d6fa98552968ddc (diff) | |
| download | luarocks-365c5a4bb52dead8d9f040d9857da448b194ada9.tar.gz luarocks-365c5a4bb52dead8d9f040d9857da448b194ada9.tar.bz2 luarocks-365c5a4bb52dead8d9f040d9857da448b194ada9.zip | |
Tests: support running with the default detected OpenSSL locations
| -rw-r--r-- | spec/build_spec.lua | 9 | ||||
| -rw-r--r-- | spec/install_spec.lua | 6 | ||||
| -rw-r--r-- | spec/upload_spec.lua | 6 | ||||
| -rw-r--r-- | spec/util/test_env.lua | 7 |
4 files changed, 12 insertions, 16 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua index 982db801..0aaa6d63 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua | |||
| @@ -202,8 +202,7 @@ describe("LuaRocks build tests #integration", function() | |||
| 202 | end) | 202 | end) |
| 203 | 203 | ||
| 204 | it("LuaRocks build luasec with skipping dependency checks", function() | 204 | it("LuaRocks build luasec with skipping dependency checks", function() |
| 205 | local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR | 205 | assert.is_true(run.luarocks_bool("build luasec 0.6-1 " .. test_env.openssl_dirs .. " --nodeps")) |
| 206 | assert.is_true(run.luarocks_bool("build luasec 0.6-1 " .. openssl_dirs .. " --nodeps")) | ||
| 207 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasec/0.6-1/luasec-0.6-1.rockspec")) | 206 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasec/0.6-1/luasec-0.6-1.rockspec")) |
| 208 | end) | 207 | end) |
| 209 | 208 | ||
| @@ -263,8 +262,7 @@ describe("LuaRocks build tests #integration", function() | |||
| 263 | end | 262 | end |
| 264 | 263 | ||
| 265 | it("LuaRocks build luasec only deps", function() | 264 | it("LuaRocks build luasec only deps", function() |
| 266 | local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR | 265 | assert.is_true(run.luarocks_bool("build luasec " .. test_env.openssl_dirs .. " --only-deps")) |
| 267 | assert.is_true(run.luarocks_bool("build luasec " .. openssl_dirs .. " --only-deps")) | ||
| 268 | assert.is_false(run.luarocks_bool("show luasec")) | 266 | assert.is_false(run.luarocks_bool("show luasec")) |
| 269 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasec/0.6-1/luasec-0.6-1.rockspec")) | 267 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_rocks .. "/luasec/0.6-1/luasec-0.6-1.rockspec")) |
| 270 | end) | 268 | end) |
| @@ -288,9 +286,8 @@ describe("LuaRocks build tests #integration", function() | |||
| 288 | end) | 286 | end) |
| 289 | 287 | ||
| 290 | it("LuaRocks build with https", function() | 288 | it("LuaRocks build with https", function() |
| 291 | local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR | ||
| 292 | assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) | 289 | assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) |
| 293 | assert.is_true(run.luarocks_bool("install luasec " .. openssl_dirs)) | 290 | assert.is_true(run.luarocks_bool("install luasec " .. test_env.openssl_dirs)) |
| 294 | 291 | ||
| 295 | assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) | 292 | assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) |
| 296 | assert.is.truthy(run.luarocks("show validate-args")) | 293 | assert.is.truthy(run.luarocks("show validate-args")) |
diff --git a/spec/install_spec.lua b/spec/install_spec.lua index f4d8a418..8a5d8f09 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua | |||
| @@ -85,8 +85,7 @@ 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 | local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR | 88 | assert.is_true(run.luarocks_bool("install luasec " .. test_env.openssl_dirs)) |
| 89 | assert.is_true(run.luarocks_bool("install luasec " .. openssl_dirs)) | ||
| 90 | assert.is_true(run.luarocks_bool("show luasocket")) | 89 | assert.is_true(run.luarocks_bool("show luasocket")) |
| 91 | end) | 90 | end) |
| 92 | end) | 91 | end) |
| @@ -139,8 +138,7 @@ describe("luarocks install #integration", function() | |||
| 139 | 138 | ||
| 140 | describe("more complex tests", function() | 139 | describe("more complex tests", function() |
| 141 | it('luasec with skipping dependency checks', function() | 140 | it('luasec with skipping dependency checks', function() |
| 142 | local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR | 141 | assert.is_true(run.luarocks_bool("install luasec " .. test_env.openssl_dirs .. " --nodeps")) |
| 143 | assert.is_true(run.luarocks_bool("install luasec " .. openssl_dirs .. " --nodeps")) | ||
| 144 | assert.is_true(run.luarocks_bool("show luasec")) | 142 | assert.is_true(run.luarocks_bool("show luasec")) |
| 145 | if env_variables.TYPE_TEST_ENV == "minimal" then | 143 | if env_variables.TYPE_TEST_ENV == "minimal" then |
| 146 | assert.is_false(run.luarocks_bool(test_env.quiet("show luasocket"))) | 144 | assert.is_false(run.luarocks_bool(test_env.quiet("show luasocket"))) |
diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua index 8290feca..76a27ee3 100644 --- a/spec/upload_spec.lua +++ b/spec/upload_spec.lua | |||
| @@ -37,13 +37,11 @@ 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 | local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR | 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"})) |
| 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"})) | ||
| 42 | end) | 41 | end) |
| 43 | 42 | ||
| 44 | it("LuaRocks upload rockspec with api-key and skip-pack", function() | 43 | it("LuaRocks upload rockspec with api-key and skip-pack", function() |
| 45 | local openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR | 44 | 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"})) |
| 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"})) | ||
| 47 | end) | 45 | end) |
| 48 | end) | 46 | end) |
| 49 | end) | 47 | end) |
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index db5cd203..d5bd90d3 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua | |||
| @@ -208,8 +208,6 @@ end | |||
| 208 | function test_env.set_args() | 208 | function 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_INCDIR = "" | ||
| 212 | test_env.OPENSSL_LIBDIR = "" | ||
| 213 | test_env.RESET_ENV = true | 211 | test_env.RESET_ENV = true |
| 214 | 212 | ||
| 215 | for _, argument in ipairs(arg) do | 213 | for _, argument in ipairs(arg) do |
| @@ -277,6 +275,11 @@ function test_env.set_args() | |||
| 277 | test_env.lib_extension = "so" | 275 | test_env.lib_extension = "so" |
| 278 | end | 276 | end |
| 279 | 277 | ||
| 278 | test_env.openssl_dirs = "" | ||
| 279 | if test_env.OPENSSL_INCDIR then | ||
| 280 | test_env.openssl_dirs = "OPENSSL_INCDIR=" .. test_env.OPENSSL_INCDIR .. " OPENSSL_LIBDIR=" .. test_env.OPENSSL_LIBDIR | ||
| 281 | end | ||
| 282 | |||
| 280 | return true | 283 | return true |
| 281 | end | 284 | end |
| 282 | 285 | ||
