aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2018-06-11 18:11:20 -0300
committerHisham Muhammad <hisham@gobolinux.org>2018-06-14 14:06:51 -0300
commitc9185f42835c52956b4cb906d765d5b4e6bb3539 (patch)
tree61f8825bc68b38a8fd953737f18aab6bafd1ba45 /spec
parentc905deaa146dcd285b5b6a0edf0d569c52ea1e5a (diff)
downloadluarocks-c9185f42835c52956b4cb906d765d5b4e6bb3539.tar.gz
luarocks-c9185f42835c52956b4cb906d765d5b4e6bb3539.tar.bz2
luarocks-c9185f42835c52956b4cb906d765d5b4e6bb3539.zip
builtin: if "libraries" is used but "external_dependencies" is not given, autogenerate it
The approach is slightly ugly since it adds builtin-specific knowledge to `luarocks.deps`, but I don't think any other build backends will support this behavior any time soon.
Diffstat (limited to 'spec')
-rw-r--r--spec/build_spec.lua27
1 files changed, 27 insertions, 0 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua
index af2dfe38..ae559654 100644
--- a/spec/build_spec.lua
+++ b/spec/build_spec.lua
@@ -311,6 +311,33 @@ describe("LuaRocks build tests #integration", function()
311 assert.truthy(run.luarocks_bool("build " .. rockspec)) 311 assert.truthy(run.luarocks_bool("build " .. rockspec))
312 assert.match("bla.lua", run.luarocks("show autodetect")) 312 assert.match("bla.lua", run.luarocks("show autodetect"))
313 end) 313 end)
314
315 it("'builtin' synthesizes external_dependencies if not given but a library is given in build", function()
316 local rockspec = "autodetect-1.0-1.rockspec"
317 test_env.write_file(rockspec, [[
318 rockspec_format = "3.0"
319 package = "autodetect"
320 version = "1.0-1"
321 source = {
322 url = "file://]] .. testing_paths.fixtures_dir .. [[/c_module.c"
323 }
324 description = {
325 summary = "An example rockspec",
326 }
327 dependencies = {
328 "lua >= 5.1"
329 }
330 build = {
331 modules = {
332 c_module = {
333 sources = "c_module.c",
334 libraries = "inexistent_library",
335 }
336 }
337 }
338 ]], finally)
339 assert.match("INEXISTENT_LIBRARY_DIR", run.luarocks("build " .. rockspec))
340 end)
314 end) 341 end)
315 342
316 describe("#mock external dependencies", function() 343 describe("#mock external dependencies", function()