diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2016-08-22 17:26:31 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-22 17:26:31 -0300 |
commit | aea914fd62e73e3106b57f36427ad36123a515a0 (patch) | |
tree | 991ad55f79c0fd267eee12b3b2b8c366f2705e68 | |
parent | 043c656a11140df8411f0635dc9b79700040d37d (diff) | |
parent | 6d9c9997645c07ed93719d85e260d9ffbc2d1d25 (diff) | |
download | luarocks-aea914fd62e73e3106b57f36427ad36123a515a0.tar.gz luarocks-aea914fd62e73e3106b57f36427ad36123a515a0.tar.bz2 luarocks-aea914fd62e73e3106b57f36427ad36123a515a0.zip |
Merge pull request #607 from robooo/new-tests
Improvement of checking openssl libs on appveyor
-rw-r--r-- | spec/build_spec.lua | 18 | ||||
-rw-r--r-- | spec/install_spec.lua | 12 | ||||
-rw-r--r-- | spec/pack_spec.lua | 6 | ||||
-rw-r--r-- | spec/upload_spec.lua | 12 | ||||
-rw-r--r-- | test/test_environment.lua | 3 |
5 files changed, 10 insertions, 41 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua index b4f838ca..8f08f0a0 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua | |||
@@ -120,11 +120,7 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
120 | end) | 120 | end) |
121 | 121 | ||
122 | it("LuaRocks build luasec with skipping dependency checks", function() | 122 | it("LuaRocks build luasec with skipping dependency checks", function() |
123 | if test_env.APPVEYOR then | 123 | assert.is_true(run.luarocks_bool("build luasec " .. test_env.OPENSSL_DIRS .. " --nodeps")) |
124 | assert.is_true(run.luarocks_bool("build luasec " .. test_env.APPVEYOR_OPENSSL .. " --nodeps")) | ||
125 | else | ||
126 | assert.is_true(run.luarocks_bool("build luasec --nodeps")) | ||
127 | end | ||
128 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec/0.6-1/luasec-0.6-1.rockspec")) | 124 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec/0.6-1/luasec-0.6-1.rockspec")) |
129 | end) | 125 | end) |
130 | 126 | ||
@@ -150,11 +146,7 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
150 | end | 146 | end |
151 | 147 | ||
152 | it("LuaRocks build luasec only deps", function() | 148 | it("LuaRocks build luasec only deps", function() |
153 | if test_env.APPVEYOR then | 149 | assert.is_true(run.luarocks_bool(test_env.quiet("build luasec " .. test_env.OPENSSL_DIRS .. " --only-deps"))) |
154 | assert.is_true(run.luarocks_bool(test_env.quiet("build luasec " .. test_env.APPVEYOR_OPENSSL .. " --only-deps"))) | ||
155 | else | ||
156 | assert.is_true(run.luarocks_bool(test_env.quiet("build luasec --only-deps"))) | ||
157 | end | ||
158 | assert.is_false(run.luarocks_bool("show luasec")) | 150 | assert.is_false(run.luarocks_bool("show luasec")) |
159 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec/0.6-1/luasec-0.6-1.rockspec")) | 151 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec/0.6-1/luasec-0.6-1.rockspec")) |
160 | end) | 152 | end) |
@@ -189,12 +181,8 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
189 | 181 | ||
190 | it("LuaRocks build with https", function() | 182 | it("LuaRocks build with https", function() |
191 | assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) | 183 | assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) |
184 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.OPENSSL_DIRS))) | ||
192 | 185 | ||
193 | if test_env.APPVEYOR then | ||
194 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.APPVEYOR_OPENSSL))) | ||
195 | else | ||
196 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec"))) | ||
197 | end | ||
198 | assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) | 186 | assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) |
199 | assert.is.truthy(run.luarocks("show validate-args")) | 187 | assert.is.truthy(run.luarocks("show validate-args")) |
200 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/validate-args/1.5.4-1/validate-args-1.5.4-1.rockspec")) | 188 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/validate-args/1.5.4-1/validate-args-1.5.4-1.rockspec")) |
diff --git a/spec/install_spec.lua b/spec/install_spec.lua index 2b6cb77f..e5b9e2cc 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua | |||
@@ -66,22 +66,14 @@ describe("LuaRocks install tests #blackbox #b_install", function() | |||
66 | end) | 66 | end) |
67 | 67 | ||
68 | it("LuaRocks install luasec and show luasocket (dependency)", function() | 68 | it("LuaRocks install luasec and show luasocket (dependency)", function() |
69 | if test_env.APPVEYOR then | 69 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.OPENSSL_DIRS))) |
70 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.APPVEYOR_OPENSSL))) | ||
71 | else | ||
72 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec"))) | ||
73 | end | ||
74 | assert.is_true(run.luarocks_bool("show luasocket")) | 70 | assert.is_true(run.luarocks_bool("show luasocket")) |
75 | end) | 71 | end) |
76 | end) | 72 | end) |
77 | 73 | ||
78 | describe("LuaRocks install - more complex tests", function() | 74 | describe("LuaRocks install - more complex tests", function() |
79 | it('LuaRocks install luasec with skipping dependency checks', function() | 75 | it('LuaRocks install luasec with skipping dependency checks', function() |
80 | if test_env.APPVEYOR then | 76 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.OPENSSL_DIRS .. " --nodeps"))) |
81 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.APPVEYOR_OPENSSL .. " --nodeps"))) | ||
82 | else | ||
83 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec --nodeps"))) | ||
84 | end | ||
85 | assert.is_true(run.luarocks_bool(test_env.quiet("show luasec"))) | 77 | assert.is_true(run.luarocks_bool(test_env.quiet("show luasec"))) |
86 | if env_variables.TYPE_TEST_ENV == "minimal" then | 78 | if env_variables.TYPE_TEST_ENV == "minimal" then |
87 | assert.is_false(run.luarocks_bool(test_env.quiet("show luasocket"))) | 79 | assert.is_false(run.luarocks_bool(test_env.quiet("show luasocket"))) |
diff --git a/spec/pack_spec.lua b/spec/pack_spec.lua index 21f33b02..3191e80c 100644 --- a/spec/pack_spec.lua +++ b/spec/pack_spec.lua | |||
@@ -49,11 +49,7 @@ describe("LuaRocks pack tests #blackbox #b_pack", function() | |||
49 | end) | 49 | end) |
50 | 50 | ||
51 | it("LuaRocks pack src", function() | 51 | it("LuaRocks pack src", function() |
52 | if test_env.APPVEYOR then | 52 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.OPENSSL_DIRS))) |
53 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec " .. test_env.APPVEYOR_OPENSSL))) | ||
54 | else | ||
55 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec"))) | ||
56 | end | ||
57 | assert.is_true(run.luarocks_bool("download --rockspec luasocket 3.0rc1-2")) | 53 | assert.is_true(run.luarocks_bool("download --rockspec luasocket 3.0rc1-2")) |
58 | assert.is_true(run.luarocks_bool("pack luasocket-3.0rc1-2.rockspec")) | 54 | assert.is_true(run.luarocks_bool("pack luasocket-3.0rc1-2.rockspec")) |
59 | assert.is_true(test_env.remove_files(lfs.currentdir(), "luasocket-")) | 55 | assert.is_true(test_env.remove_files(lfs.currentdir(), "luasocket-")) |
diff --git a/spec/upload_spec.lua b/spec/upload_spec.lua index af4c36d3..ff39cb96 100644 --- a/spec/upload_spec.lua +++ b/spec/upload_spec.lua | |||
@@ -63,18 +63,10 @@ describe("LuaRocks upload tests #blackbox #b_upload", function() | |||
63 | end) | 63 | end) |
64 | 64 | ||
65 | it("LuaRocks upload rockspec with api-key", function() | 65 | it("LuaRocks upload rockspec with api-key", function() |
66 | if test_env.APPVEYOR then | 66 | assert.is_true(run.luarocks_bool("upload " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec " .. test_env.OPENSSL_DIRS .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) |
67 | assert.is_true(run.luarocks_bool("upload " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec " .. test_env.APPVEYOR_OPENSSL .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) | ||
68 | else | ||
69 | assert.is_true(run.luarocks_bool("upload " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) | ||
70 | end | ||
71 | end) | 67 | end) |
72 | it("LuaRocks upload rockspec with api-key and skip-pack", function() | 68 | it("LuaRocks upload rockspec with api-key and skip-pack", function() |
73 | if test_env.APPVEYOR then | 69 | assert.is_true(run.luarocks_bool("upload --skip-pack " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec " .. test_env.OPENSSL_DIRS .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) |
74 | assert.is_true(run.luarocks_bool("upload --skip-pack " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec " .. test_env.APPVEYOR_OPENSSL .. " --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) | ||
75 | else | ||
76 | assert.is_true(run.luarocks_bool("upload --skip-pack " .. testing_paths.testing_server .. "/luasocket-3.0rc1-2.rockspec --api-key=123", {LUAROCKS_CONFIG = testing_paths.testing_dir .. "/luarocks_site.lua"})) | ||
77 | end | ||
78 | end) | 70 | end) |
79 | end) | 71 | end) |
80 | end) | 72 | end) |
diff --git a/test/test_environment.lua b/test/test_environment.lua index 37bd38f1..ab6c3edd 100644 --- a/test/test_environment.lua +++ b/test/test_environment.lua | |||
@@ -153,6 +153,7 @@ end | |||
153 | function test_env.set_args() | 153 | function test_env.set_args() |
154 | -- if at least Lua/LuaJIT version argument was found on input start to parse other arguments to env. variables | 154 | -- if at least Lua/LuaJIT version argument was found on input start to parse other arguments to env. variables |
155 | test_env.TYPE_TEST_ENV = "minimal" | 155 | test_env.TYPE_TEST_ENV = "minimal" |
156 | test_env.OPENSSL_DIRS = "" | ||
156 | test_env.RESET_ENV = true | 157 | test_env.RESET_ENV = true |
157 | 158 | ||
158 | for _, argument in ipairs(arg) do | 159 | for _, argument in ipairs(arg) do |
@@ -168,7 +169,7 @@ function test_env.set_args() | |||
168 | test_env.TRAVIS = true | 169 | test_env.TRAVIS = true |
169 | elseif argument == "appveyor" then | 170 | elseif argument == "appveyor" then |
170 | test_env.APPVEYOR = true | 171 | test_env.APPVEYOR = true |
171 | test_env.APPVEYOR_OPENSSL = "OPENSSL_LIBDIR=C:\\OpenSSL-Win32\\lib OPENSSL_INCDIR=C:\\OpenSSL-Win32\\include" | 172 | test_env.OPENSSL_DIRS = "OPENSSL_LIBDIR=C:\\OpenSSL-Win32\\lib OPENSSL_INCDIR=C:\\OpenSSL-Win32\\include" |
172 | elseif argument:find("^os=") then | 173 | elseif argument:find("^os=") then |
173 | test_env.TEST_TARGET_OS = argument:match("^os=(.*)$") | 174 | test_env.TEST_TARGET_OS = argument:match("^os=(.*)$") |
174 | else | 175 | else |