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