aboutsummaryrefslogtreecommitdiff
path: root/spec/build_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/build_spec.lua')
-rw-r--r--spec/build_spec.lua79
1 files changed, 49 insertions, 30 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index 2ede5211..2ff7cbe6 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,63 +58,82 @@ 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
84 describe("LuaRocks build - basic builds", function() 93 describe("LuaRocks build - basic builds", function()
85 it("LuaRocks build luadoc", function() 94 it("LuaRocks build luadoc", function()
86 assert.is_true(run.luarocks_bool(test_env.quiet("build luadoc"))) 95 assert.is_true(run.luarocks_bool("build luadoc"))
87 end) 96 end)
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("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 assert.is_true(run.luarocks_bool("build luasec " .. test_env.OPENSSL_DIRS .. " --nodeps"))
111 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec")) 124 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec/0.6-1/luasec-0.6-1.rockspec"))
112 end) 125 end)
113 126
114 it("LuaRocks build lmathx deps partial match", function() 127 it("LuaRocks build lmathx deps partial match", function()
115 assert.is_true(run.luarocks_bool("build lmathx")) 128 assert.is_true(run.luarocks_bool("build lmathx"))
116 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lmathx")) 129
130 if test_env.LUA_V == "5.1" or test_env.LUAJIT_V then
131 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lmathx/20120430.51-1/lmathx-20120430.51-1.rockspec"))
132 elseif test_env.LUA_V == "5.2" then
133 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lmathx/20120430.52-1/lmathx-20120430.52-1.rockspec"))
134 elseif test_env.LUA_V == "5.3" then
135 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lmathx/20150505-1/lmathx-20150505-1.rockspec"))
136 end
117 end) 137 end)
118 end) 138 end)
119 139
@@ -126,17 +146,17 @@ describe("LuaRocks build tests #blackbox #b_build", function()
126 end 146 end
127 147
128 it("LuaRocks build luasec only deps", function() 148 it("LuaRocks build luasec only deps", function()
129 assert.is_true(run.luarocks_bool(test_env.quiet("build luasec --only-deps"))) 149 assert.is_true(run.luarocks_bool("build luasec " .. test_env.OPENSSL_DIRS .. " --only-deps"))
130 assert.is_false(run.luarocks_bool("show luasec")) 150 assert.is_false(run.luarocks_bool("show luasec"))
131 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec")) 151 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/luasec/0.6-1/luasec-0.6-1.rockspec"))
132 end) 152 end)
133 153
134 it("LuaRocks build only deps of downloaded rockspec of lxsh", function() 154 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")) 155 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")) 156 assert.is.truthy(run.luarocks("build lxsh-0.8.6-2.rockspec --only-deps"))
137 assert.is_false(run.luarocks_bool("show lxsh")) 157 assert.is_false(run.luarocks_bool("show lxsh"))
138 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) 158 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")) 159 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")) 160 assert.is_true(os.remove("lxsh-0.8.6-2.rockspec"))
141 end) 161 end)
142 162
@@ -144,8 +164,8 @@ describe("LuaRocks build tests #blackbox #b_build", function()
144 assert.is_true(run.luarocks_bool("download --source lxsh 0.8.6-2")) 164 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")) 165 assert.is.truthy(run.luarocks("build lxsh-0.8.6-2.src.rock --only-deps"))
146 assert.is_false(run.luarocks_bool("show lxsh")) 166 assert.is_false(run.luarocks_bool("show lxsh"))
147 assert.is.falsy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/lxsh")) 167 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")) 168 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")) 169 assert.is_true(os.remove("lxsh-0.8.6-2.src.rock"))
150 end) 170 end)
151 171
@@ -154,19 +174,18 @@ describe("LuaRocks build tests #blackbox #b_build", function()
154 assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec")) 174 assert.is_true(run.luarocks_bool("build validate-args-1.5.4-1.rockspec"))
155 175
156 assert.is.truthy(run.luarocks("show validate-args")) 176 assert.is.truthy(run.luarocks("show validate-args"))
157 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/validate-args")) 177 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 178
159 assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) 179 assert.is_true(os.remove("validate-args-1.5.4-1.rockspec"))
160 end) 180 end)
161 181
162 it("LuaRocks build with https", function() 182 it("LuaRocks build with https", function()
163 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"))
164 assert.is_true(run.luarocks_bool(test_env.quiet("install luasec"))) 184 assert.is_true(run.luarocks_bool("install luasec " .. test_env.OPENSSL_DIRS))
185
165 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"))
166
167 assert.is.truthy(run.luarocks("show validate-args")) 187 assert.is.truthy(run.luarocks("show validate-args"))
168 assert.is.truthy(lfs.attributes(testing_paths.testing_sys_tree .. "/lib/luarocks/rocks/validate-args")) 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"))
169
170 assert.is_true(os.remove("validate-args-1.5.4-1.rockspec")) 189 assert.is_true(os.remove("validate-args-1.5.4-1.rockspec"))
171 end) 190 end)
172 191