diff options
Diffstat (limited to 'spec/quick/build.q')
-rw-r--r-- | spec/quick/build.q | 103 |
1 files changed, 98 insertions, 5 deletions
diff --git a/spec/quick/build.q b/spec/quick/build.q index a1731da2..ee519adf 100644 --- a/spec/quick/build.q +++ b/spec/quick/build.q | |||
@@ -1,4 +1,7 @@ | |||
1 | TEST: luarocks build: fails when given invalid argument | 1 | SUITE: luarocks build |
2 | |||
3 | ================================================================================ | ||
4 | TEST: fails when given invalid argument | ||
2 | RUN: luarocks build aoesuthaoeusahtoeustnaou --only-server=localhost | 5 | RUN: luarocks build aoesuthaoeusahtoeustnaou --only-server=localhost |
3 | EXIT: 1 | 6 | EXIT: 1 |
4 | STDERR: | 7 | STDERR: |
@@ -9,7 +12,7 @@ Could not find a result named aoesuthaoeusahtoeustnaou | |||
9 | 12 | ||
10 | 13 | ||
11 | ================================================================================ | 14 | ================================================================================ |
12 | TEST: luarocks build: with no arguments behaves as luarocks make | 15 | TEST: with no arguments behaves as luarocks make |
13 | 16 | ||
14 | FILE: c_module-1.0-1.rockspec | 17 | FILE: c_module-1.0-1.rockspec |
15 | -------------------------------------------------------------------------------- | 18 | -------------------------------------------------------------------------------- |
@@ -43,7 +46,7 @@ EXISTS: c_module.%{lib_extension} | |||
43 | 46 | ||
44 | 47 | ||
45 | ================================================================================ | 48 | ================================================================================ |
46 | TEST: luarocks build: defaults to builtin type | 49 | TEST: defaults to builtin type |
47 | 50 | ||
48 | FILE: a_rock-1.0-1.rockspec | 51 | FILE: a_rock-1.0-1.rockspec |
49 | -------------------------------------------------------------------------------- | 52 | -------------------------------------------------------------------------------- |
@@ -74,7 +77,7 @@ a_rock 1.0 | |||
74 | 77 | ||
75 | 78 | ||
76 | ================================================================================ | 79 | ================================================================================ |
77 | TEST: luarocks build: fails if no permissions to access the specified tree #unix | 80 | TEST: fails if no permissions to access the specified tree #unix |
78 | 81 | ||
79 | RUN: luarocks build --tree=/usr ./a_rock-1.0.1-rockspec | 82 | RUN: luarocks build --tree=/usr ./a_rock-1.0.1-rockspec |
80 | EXIT: 4 | 83 | EXIT: 4 |
@@ -99,7 +102,7 @@ NOT_EXISTS: %{testing_sys_rocks}/a_rock/1.0-1/a_rock-1.0-1.rockspec | |||
99 | 102 | ||
100 | 103 | ||
101 | ================================================================================ | 104 | ================================================================================ |
102 | TEST: luarocks build: fails if no permissions to access the parent #unix | 105 | TEST: fails if no permissions to access the parent #unix |
103 | 106 | ||
104 | RUN: luarocks build --tree=/usr/invalid ./a_rock-1.0.1-rockspec | 107 | RUN: luarocks build --tree=/usr/invalid ./a_rock-1.0.1-rockspec |
105 | EXIT: 4 | 108 | EXIT: 4 |
@@ -160,3 +163,93 @@ STDOUT: | |||
160 | a_rock 1.0-1 is already installed | 163 | a_rock 1.0-1 is already installed |
161 | Use --force to reinstall | 164 | Use --force to reinstall |
162 | -------------------------------------------------------------------------------- | 165 | -------------------------------------------------------------------------------- |
166 | |||
167 | |||
168 | |||
169 | ================================================================================ | ||
170 | TEST: supports --pin #pinning | ||
171 | |||
172 | FILE: test-1.0-1.rockspec | ||
173 | -------------------------------------------------------------------------------- | ||
174 | package = "test" | ||
175 | version = "1.0-1" | ||
176 | source = { | ||
177 | url = "file://%{url(tmpdir)}/test.lua" | ||
178 | } | ||
179 | dependencies = { | ||
180 | "a_rock >= 0.8" | ||
181 | } | ||
182 | build = { | ||
183 | type = "builtin", | ||
184 | modules = { | ||
185 | test = "test.lua" | ||
186 | } | ||
187 | } | ||
188 | -------------------------------------------------------------------------------- | ||
189 | |||
190 | FILE: test.lua | ||
191 | -------------------------------------------------------------------------------- | ||
192 | return {} | ||
193 | -------------------------------------------------------------------------------- | ||
194 | |||
195 | RUN: luarocks build --only-server=%{fixtures_dir}/a_repo test-1.0-1.rockspec --pin --tree=lua_modules | ||
196 | |||
197 | EXISTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/test/1.0-1/test-1.0-1.rockspec | ||
198 | EXISTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/a_rock/2.0-1/a_rock-2.0-1.rockspec | ||
199 | |||
200 | EXISTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/test/1.0-1/luarocks.lock | ||
201 | |||
202 | FILE_CONTENTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/test/1.0-1/luarocks.lock | ||
203 | -------------------------------------------------------------------------------- | ||
204 | return { | ||
205 | dependencies = { | ||
206 | a_rock = "2.0-1", | ||
207 | lua = "%{lua_version}-1" | ||
208 | } | ||
209 | } | ||
210 | -------------------------------------------------------------------------------- | ||
211 | |||
212 | |||
213 | |||
214 | ================================================================================ | ||
215 | TEST: supports --pin --only-deps #pinning | ||
216 | |||
217 | FILE: test-1.0-1.rockspec | ||
218 | -------------------------------------------------------------------------------- | ||
219 | package = "test" | ||
220 | version = "1.0-1" | ||
221 | source = { | ||
222 | url = "file://%{url(tmpdir)}/test.lua" | ||
223 | } | ||
224 | dependencies = { | ||
225 | "a_rock >= 0.8" | ||
226 | } | ||
227 | build = { | ||
228 | type = "builtin", | ||
229 | modules = { | ||
230 | test = "test.lua" | ||
231 | } | ||
232 | } | ||
233 | -------------------------------------------------------------------------------- | ||
234 | |||
235 | FILE: test.lua | ||
236 | -------------------------------------------------------------------------------- | ||
237 | return {} | ||
238 | -------------------------------------------------------------------------------- | ||
239 | |||
240 | RUN: luarocks build --only-server=%{fixtures_dir}/a_repo test-1.0-1.rockspec --pin --only-deps --tree=lua_modules | ||
241 | |||
242 | NOT_EXISTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/test/1.0-1/test-1.0-1.rockspec | ||
243 | EXISTS: ./lua_modules/lib/luarocks/rocks-%{lua_version}/a_rock/2.0-1/a_rock-2.0-1.rockspec | ||
244 | |||
245 | EXISTS: ./luarocks.lock | ||
246 | |||
247 | FILE_CONTENTS: ./luarocks.lock | ||
248 | -------------------------------------------------------------------------------- | ||
249 | return { | ||
250 | dependencies = { | ||
251 | a_rock = "2.0-1", | ||
252 | lua = "%{lua_version}-1" | ||
253 | } | ||
254 | } | ||
255 | -------------------------------------------------------------------------------- | ||