diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2017-11-06 18:11:38 -0200 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2017-11-06 18:26:32 -0200 |
| commit | 9c7e9fed578b58fff14e7a3dd95bdad62ff6ab31 (patch) | |
| tree | caf5be2af131c535b3f9901cd379f08dcf0d3752 /spec | |
| parent | c9d9487e9e21fb2454b4c7f89494299b7473b0d1 (diff) | |
| download | luarocks-9c7e9fed578b58fff14e7a3dd95bdad62ff6ab31.tar.gz luarocks-9c7e9fed578b58fff14e7a3dd95bdad62ff6ab31.tar.bz2 luarocks-9c7e9fed578b58fff14e7a3dd95bdad62ff6ab31.zip | |
Tests: build using INCDIR for an external dependency
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/build_spec.lua | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua index ffae144d..c6d5f717 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua | |||
| @@ -189,12 +189,30 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
| 189 | 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")) |
| 190 | end) | 190 | end) |
| 191 | 191 | ||
| 192 | it("LuaRocks build missing external", function() | ||
| 193 | assert.is_false(run.luarocks_bool("build " .. testing_paths.testing_dir .. "/testfiles/missing_external-0.1-1.rockspec INEXISTENT_INCDIR=\"/invalid/dir\"")) | ||
| 194 | end) | ||
| 195 | |||
| 196 | it("LuaRocks build invalid patch", function() | 192 | it("LuaRocks build invalid patch", function() |
| 197 | assert.is_false(run.luarocks_bool("build " .. testing_paths.testing_dir .. "/testfiles/invalid_patch-0.1-1.rockspec")) | 193 | assert.is_false(run.luarocks_bool("build " .. testing_paths.testing_dir .. "/testfiles/invalid_patch-0.1-1.rockspec")) |
| 198 | end) | 194 | end) |
| 199 | end) | 195 | end) |
| 196 | |||
| 197 | describe("external dependencies", function() | ||
| 198 | setup(function() | ||
| 199 | test_env.mock_server_init() | ||
| 200 | end) | ||
| 201 | |||
| 202 | teardown(function() | ||
| 203 | test_env.mock_server_done() | ||
| 204 | end) | ||
| 205 | |||
| 206 | it("fails when missing external dependency", function() | ||
| 207 | assert.is_false(run.luarocks_bool("build " .. testing_paths.testing_dir .. "/testfiles/missing_external-0.1-1.rockspec INEXISTENT_INCDIR=\"/invalid/dir\"")) | ||
| 208 | end) | ||
| 209 | |||
| 210 | it("builds with external dependency", function() | ||
| 211 | local rockspec = testing_paths.testing_dir .. "/testfiles/with_external_dep-0.1-1.rockspec" | ||
| 212 | local foo_incdir = testing_paths.testing_dir .. "/testfiles/with_external_dep" | ||
| 213 | assert.is_truthy(run.luarocks_bool("build " .. rockspec .. " FOO_INCDIR=\"" .. foo_incdir .. "\"")) | ||
| 214 | assert.is.truthy(run.luarocks("show with_external_dep")) | ||
| 215 | end) | ||
| 216 | end) | ||
| 217 | |||
| 200 | end) | 218 | end) |
