diff options
Diffstat (limited to 'spec/build_spec.lua')
| -rw-r--r-- | spec/build_spec.lua | 89 |
1 files changed, 60 insertions, 29 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua index 2ede5211..b4f838ca 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua | |||
| @@ -12,15 +12,16 @@ local extra_rocks = { | |||
| 12 | "/lmathx-20120430.52-1.rockspec", | 12 | "/lmathx-20120430.52-1.rockspec", |
| 13 | "/lmathx-20150505-1.src.rock", | 13 | "/lmathx-20150505-1.src.rock", |
| 14 | "/lmathx-20150505-1.rockspec", | 14 | "/lmathx-20150505-1.rockspec", |
| 15 | "/lpeg-0.12-1.src.rock", | 15 | "/lpeg-1.0.0-1.rockspec", |
| 16 | "/lpeg-1.0.0-1.src.rock", | ||
| 16 | "/lpty-1.0.1-1.src.rock", | 17 | "/lpty-1.0.1-1.src.rock", |
| 17 | "/luadoc-3.0.1-1.src.rock", | 18 | "/luadoc-3.0.1-1.src.rock", |
| 18 | "/luafilesystem-1.6.3-1.src.rock", | 19 | "/luafilesystem-1.6.3-1.src.rock", |
| 19 | "/lualogging-1.3.0-1.src.rock", | 20 | "/lualogging-1.3.0-1.src.rock", |
| 20 | "/luarepl-0.4-1.src.rock", | 21 | "/luarepl-0.4-1.src.rock", |
| 21 | "/luasec-0.6-1.rockspec", | 22 | "/luasec-0.6-1.rockspec", |
| 22 | "/luasocket-3.0rc1-1.src.rock", | 23 | "/luasocket-3.0rc1-2.src.rock", |
| 23 | "/luasocket-3.0rc1-1.rockspec", | 24 | "/luasocket-3.0rc1-2.rockspec", |
| 24 | "/lxsh-0.8.6-2.src.rock", | 25 | "/lxsh-0.8.6-2.src.rock", |
| 25 | "/lxsh-0.8.6-2.rockspec", | 26 | "/lxsh-0.8.6-2.rockspec", |
| 26 | "/stdlib-41.0.0-1.src.rock", | 27 | "/stdlib-41.0.0-1.src.rock", |
| @@ -57,27 +58,35 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
| 57 | end) | 58 | end) |
| 58 | 59 | ||
| 59 | it("LuaRocks build lpeg verbose", function() | 60 | it("LuaRocks build lpeg verbose", function() |
| 60 | assert.is.truthy(run.luarocks("build --verbose lpeg")) | 61 | assert.is_true(run.luarocks_bool("build --verbose lpeg")) |
| 61 | end) | 62 | end) |
| 62 | 63 | ||
| 63 | it("LuaRocks build lpeg branch=master", function() | 64 | it("LuaRocks build lpeg branch=master", function() |
| 64 | assert.is_true(run.luarocks_bool("build --branch=master lpeg")) | 65 | assert.is_true(run.luarocks_bool("build --branch=master lpeg")) |
| 65 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg")) | 66 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) |
| 66 | end) | 67 | end) |
| 67 | 68 | ||
| 68 | it("LuaRocks build lpeg deps-mode=123", function() | 69 | it("LuaRocks build lpeg deps-mode=123", function() |
| 69 | assert.is_false(run.luarocks_bool("build --deps-mode=123 lpeg")) | 70 | assert.is_false(run.luarocks_bool("build --deps-mode=123 lpeg --verbose")) |
| 70 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg")) | 71 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) |
| 71 | end) | 72 | end) |
| 72 | 73 | ||
| 73 | it("LuaRocks build lpeg only-sources example", function() | 74 | it("LuaRocks build lpeg only-sources example", function() |
| 74 | assert.is_true(run.luarocks_bool("build --only-sources=\"http://example.com\" lpeg")) | 75 | assert.is_true(run.luarocks_bool("download --rockspec lpeg")) |
| 75 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg")) | 76 | assert.is_false(run.luarocks_bool("build --only-sources=\"http://example.com\" lpeg-1.0.0-1.rockspec")) |
| 77 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | ||
| 78 | |||
| 79 | assert.is_true(run.luarocks_bool("download --source lpeg")) | ||
| 80 | assert.is_true(run.luarocks_bool("build --only-sources=\"http://example.com\" lpeg-1.0.0-1.src.rock")) | ||
| 81 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) | ||
| 82 | |||
| 83 | assert.is_true(os.remove("lpeg-1.0.0-1.rockspec")) | ||
| 84 | assert.is_true(os.remove("lpeg-1.0.0-1.src.rock")) | ||
| 76 | end) | 85 | end) |
| 77 | 86 | ||
| 78 | it("LuaRocks build lpeg with empty tree", function() | 87 | it("LuaRocks build lpeg with empty tree", function() |
| 79 | assert.is_false(run.luarocks_bool("build --tree=\"\" lpeg")) | 88 | assert.is_false(run.luarocks_bool("build --tree=\"\" lpeg")) |
| 80 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg")) | 89 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) |
| 81 | end) | 90 | end) |
| 82 | end) | 91 | end) |
| 83 | 92 | ||
| @@ -88,32 +97,47 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
| 88 | 97 | ||
| 89 | it("LuaRocks build luacov diff version", function() | 98 | it("LuaRocks build luacov diff version", function() |
| 90 | assert.is_true(run.luarocks_bool("build luacov 0.11.0-1")) | 99 | assert.is_true(run.luarocks_bool("build luacov 0.11.0-1")) |
| 91 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luacov")) | 100 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luacov/0.11.0-1/luacov-0.11.0-1.rockspec")) |
| 92 | end) | 101 | end) |
| 93 | 102 | ||
| 94 | it("LuaRocks build command stdlib", function() | 103 | it("LuaRocks build command stdlib", function() |
| 95 | assert.is_true(run.luarocks_bool("build stdlib")) | 104 | assert.is_true(run.luarocks_bool("build stdlib")) |
| 96 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/stdlib")) | 105 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/stdlib/41.0.0-1/stdlib-41.0.0-1.rockspec")) |
| 97 | end) | 106 | end) |
| 98 | 107 | ||
| 99 | it("LuaRocks build install bin luarepl", function() | 108 | it("LuaRocks build install bin luarepl", function() |
| 100 | assert.is_true(run.luarocks_bool("build luarepl")) | 109 | assert.is_true(run.luarocks_bool("build luarepl")) |
| 101 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luarepl")) | 110 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luarepl/0.4-1/luarepl-0.4-1.rockspec")) |
| 102 | end) | 111 | end) |
| 103 | 112 | ||
| 104 | it("LuaRocks build supported platforms lpty", function() | 113 | it("LuaRocks build supported platforms lpty", function() |
| 105 | assert.is_true(run.luarocks_bool(test_env.quiet("build lpty"))) | 114 | if test_env.TEST_TARGET_OS == "windows" then |
| 106 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpty")) | 115 | assert.is_false(run.luarocks_bool("build lpty")) --Error: This rockspec for lpty does not support win32, windows platforms |
| 116 | else | ||
| 117 | assert.is_true(run.luarocks_bool(test_env.quiet("build lpty"))) | ||
| 118 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpty/1.0.1-1/lpty-1.0.1-1.rockspec")) | ||
| 119 | end | ||
| 107 | end) | 120 | end) |
| 108 | 121 | ||
| 109 | it("LuaRocks build luasec with skipping dependency checks", function() | 122 | it("LuaRocks build luasec with skipping dependency checks", function() |
| 110 | assert.is_true(run.luarocks_bool(test_env.quiet("build luasec --nodeps"))) | 123 | if test_env.APPVEYOR then |
| 111 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec")) | 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")) | ||
| 112 | end) | 129 | end) |
| 113 | 130 | ||
| 114 | it("LuaRocks build lmathx deps partial match", function() | 131 | it("LuaRocks build lmathx deps partial match", function() |
| 115 | assert.is_true(run.luarocks_bool("build lmathx")) | 132 | assert.is_true(run.luarocks_bool("build lmathx")) |
| 116 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lmathx")) | 133 | |
| 134 | if test_env.LUA_V == "5.1" or test_env.LUAJIT_V then | ||
| 135 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lmathx/20120430.51-1/lmathx-20120430.51-1.rockspec")) | ||
| 136 | elseif test_env.LUA_V == "5.2" then | ||
| 137 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lmathx/20120430.52-1/lmathx-20120430.52-1.rockspec")) | ||
| 138 | elseif test_env.LUA_V == "5.3" then | ||
| 139 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lmathx/20150505-1/lmathx-20150505-1.rockspec")) | ||
| 140 | end | ||
| 117 | end) | 141 | end) |
| 118 | end) | 142 | end) |
| 119 | 143 | ||
| @@ -126,17 +150,21 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
| 126 | end | 150 | end |
| 127 | 151 | ||
| 128 | it("LuaRocks build luasec only deps", function() | 152 | it("LuaRocks build luasec only deps", function() |
| 129 | assert.is_true(run.luarocks_bool(test_env.quiet("build luasec --only-deps"))) | 153 | if test_env.APPVEYOR then |
| 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 | ||
| 130 | assert.is_false(run.luarocks_bool("show luasec")) | 158 | assert.is_false(run.luarocks_bool("show luasec")) |
| 131 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec")) | 159 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec/0.6-1/luasec-0.6-1.rockspec")) |
| 132 | end) | 160 | end) |
| 133 | 161 | ||
| 134 | it("LuaRocks build only deps of downloaded rockspec of lxsh", function() | 162 | it("LuaRocks build only deps of downloaded rockspec of lxsh", function() |
| 135 | assert.is_true(run.luarocks_bool("download --rockspec lxsh 0.8.6-2")) | 163 | assert.is_true(run.luarocks_bool("download --rockspec lxsh 0.8.6-2")) |
| 136 | assert.is.truthy(run.luarocks("build lxsh-0.8.6-2.rockspec --only-deps")) | 164 | assert.is.truthy(run.luarocks("build lxsh-0.8.6-2.rockspec --only-deps")) |
| 137 | assert.is_false(run.luarocks_bool("show lxsh")) | 165 | assert.is_false(run.luarocks_bool("show lxsh")) |
| 138 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) | 166 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) |
| 139 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg")) | 167 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) |
| 140 | assert.is_true(os.remove("lxsh-0.8.6-2.rockspec")) | 168 | assert.is_true(os.remove("lxsh-0.8.6-2.rockspec")) |
| 141 | end) | 169 | end) |
| 142 | 170 | ||
| @@ -144,8 +172,8 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
| 144 | assert.is_true(run.luarocks_bool("download --source lxsh 0.8.6-2")) | 172 | assert.is_true(run.luarocks_bool("download --source lxsh 0.8.6-2")) |
| 145 | assert.is.truthy(run.luarocks("build lxsh-0.8.6-2.src.rock --only-deps")) | 173 | assert.is.truthy(run.luarocks("build lxsh-0.8.6-2.src.rock --only-deps")) |
| 146 | assert.is_false(run.luarocks_bool("show lxsh")) | 174 | assert.is_false(run.luarocks_bool("show lxsh")) |
| 147 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) | 175 | assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh/0.8.6-2/lxsh-0.8.6-2.rockspec")) |
| 148 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg")) | 176 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lpeg/1.0.0-1/lpeg-1.0.0-1.rockspec")) |
| 149 | assert.is_true(os.remove("lxsh-0.8.6-2.src.rock")) | 177 | assert.is_true(os.remove("lxsh-0.8.6-2.src.rock")) |
| 150 | end) | 178 | end) |
| 151 | 179 | ||
| @@ -154,19 +182,22 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
| 154 | assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) | 182 | assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) |
| 155 | 183 | ||
| 156 | assert.is.truthy(run.luarocks("show validate-args")) | 184 | assert.is.truthy(run.luarocks("show validate-args")) |
| 157 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/validate-args")) | 185 | 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")) |
| 158 | 186 | ||
| 159 | assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) | 187 | assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) |
| 160 | end) | 188 | end) |
| 161 | 189 | ||
| 162 | it("LuaRocks build with https", function() | 190 | it("LuaRocks build with https", function() |
| 163 | assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) | 191 | assert.is_true(run.luarocks_bool("download --rockspec validate-args 1.5.4-1")) |
| 164 | assert.is_true(run.luarocks_bool(test_env.quiet("install luasec"))) | 192 | |
| 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 | ||
| 165 | assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) | 198 | assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) |
| 166 | |||
| 167 | assert.is.truthy(run.luarocks("show validate-args")) | 199 | assert.is.truthy(run.luarocks("show validate-args")) |
| 168 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/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")) |
| 169 | |||
| 170 | assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) | 201 | assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) |
| 171 | end) | 202 | end) |
| 172 | 203 | ||
