diff options
-rw-r--r-- | spec/build_spec.lua | 8 | ||||
-rw-r--r-- | spec/fixtures/a_repo/a_build_dep-1.0-1.rockspec | 18 | ||||
-rw-r--r-- | spec/fixtures/a_repo/a_build_dep-1.0-1.src.rock | bin | 0 -> 575 bytes | |||
-rw-r--r-- | spec/fixtures/a_repo/has_build_dep-1.0-1.all.rock | bin | 0 -> 1010 bytes | |||
-rw-r--r-- | spec/fixtures/a_repo/has_build_dep-1.0-1.rockspec | 22 | ||||
-rw-r--r-- | spec/fixtures/a_repo/has_build_dep-1.0-1.src.rock | bin | 0 -> 584 bytes | |||
-rw-r--r-- | spec/fixtures/a_repo/manifest | 23 | ||||
-rw-r--r-- | spec/fixtures/a_repo/manifest-5.1 | 23 | ||||
-rw-r--r-- | spec/fixtures/a_repo/manifest-5.2 | 23 | ||||
-rw-r--r-- | spec/fixtures/a_repo/manifest-5.3 | 23 | ||||
-rw-r--r-- | spec/install_spec.lua | 9 |
11 files changed, 149 insertions, 0 deletions
diff --git a/spec/build_spec.lua b/spec/build_spec.lua index ed36dbd2..5c363570 100644 --- a/spec/build_spec.lua +++ b/spec/build_spec.lua | |||
@@ -249,5 +249,13 @@ describe("LuaRocks build tests #blackbox #b_build", function() | |||
249 | assert.is.truthy(run.luarocks("show with_external_dep")) | 249 | assert.is.truthy(run.luarocks("show with_external_dep")) |
250 | end) | 250 | end) |
251 | end) | 251 | end) |
252 | |||
253 | describe("#build_dependencies", function() | ||
254 | it("builds with a build dependency", function() | ||
255 | assert(run.luarocks_bool("build has_build_dep --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | ||
256 | assert(run.luarocks_bool("show has_build_dep 1.0")) | ||
257 | assert(run.luarocks_bool("show a_build_dep 1.0")) | ||
258 | end) | ||
259 | end) | ||
252 | 260 | ||
253 | end) | 261 | end) |
diff --git a/spec/fixtures/a_repo/a_build_dep-1.0-1.rockspec b/spec/fixtures/a_repo/a_build_dep-1.0-1.rockspec new file mode 100644 index 00000000..2398d3db --- /dev/null +++ b/spec/fixtures/a_repo/a_build_dep-1.0-1.rockspec | |||
@@ -0,0 +1,18 @@ | |||
1 | rockspec_format = "3.0" | ||
2 | package = "a_build_dep" | ||
3 | version = "1.0-1" | ||
4 | source = { | ||
5 | url = "http://localhost:8080/file/a_rock.lua" | ||
6 | } | ||
7 | description = { | ||
8 | summary = "An example rockspec that is a build dependency for has_build_dep.", | ||
9 | } | ||
10 | dependencies = { | ||
11 | "lua >= 5.1", | ||
12 | } | ||
13 | build = { | ||
14 | type = "builtin", | ||
15 | modules = { | ||
16 | build_dep = "a_rock.lua" | ||
17 | }, | ||
18 | } | ||
diff --git a/spec/fixtures/a_repo/a_build_dep-1.0-1.src.rock b/spec/fixtures/a_repo/a_build_dep-1.0-1.src.rock new file mode 100644 index 00000000..c56ee34d --- /dev/null +++ b/spec/fixtures/a_repo/a_build_dep-1.0-1.src.rock | |||
Binary files differ | |||
diff --git a/spec/fixtures/a_repo/has_build_dep-1.0-1.all.rock b/spec/fixtures/a_repo/has_build_dep-1.0-1.all.rock new file mode 100644 index 00000000..a2d09ab2 --- /dev/null +++ b/spec/fixtures/a_repo/has_build_dep-1.0-1.all.rock | |||
Binary files differ | |||
diff --git a/spec/fixtures/a_repo/has_build_dep-1.0-1.rockspec b/spec/fixtures/a_repo/has_build_dep-1.0-1.rockspec new file mode 100644 index 00000000..417473a6 --- /dev/null +++ b/spec/fixtures/a_repo/has_build_dep-1.0-1.rockspec | |||
@@ -0,0 +1,22 @@ | |||
1 | rockspec_format = "3.0" | ||
2 | package = "has_build_dep" | ||
3 | version = "1.0-1" | ||
4 | source = { | ||
5 | url = "http://localhost:8080/file/a_rock.lua" | ||
6 | } | ||
7 | description = { | ||
8 | summary = "An example rockspec that has build dependencies.", | ||
9 | } | ||
10 | dependencies = { | ||
11 | "a_rock", | ||
12 | "lua >= 5.1", | ||
13 | } | ||
14 | build_dependencies = { | ||
15 | "a_build_dep", | ||
16 | } | ||
17 | build = { | ||
18 | type = "builtin", | ||
19 | modules = { | ||
20 | bla = "a_rock.lua" | ||
21 | }, | ||
22 | } | ||
diff --git a/spec/fixtures/a_repo/has_build_dep-1.0-1.src.rock b/spec/fixtures/a_repo/has_build_dep-1.0-1.src.rock new file mode 100644 index 00000000..fc4e11b9 --- /dev/null +++ b/spec/fixtures/a_repo/has_build_dep-1.0-1.src.rock | |||
Binary files differ | |||
diff --git a/spec/fixtures/a_repo/manifest b/spec/fixtures/a_repo/manifest index 141dafb5..1a5f8d55 100644 --- a/spec/fixtures/a_repo/manifest +++ b/spec/fixtures/a_repo/manifest | |||
@@ -1,6 +1,16 @@ | |||
1 | commands = {} | 1 | commands = {} |
2 | modules = {} | 2 | modules = {} |
3 | repository = { | 3 | repository = { |
4 | a_build_dep = { | ||
5 | ["1.0-1"] = { | ||
6 | { | ||
7 | arch = "src" | ||
8 | }, | ||
9 | { | ||
10 | arch = "rockspec" | ||
11 | } | ||
12 | } | ||
13 | }, | ||
4 | a_rock = { | 14 | a_rock = { |
5 | ["1.0-1"] = { | 15 | ["1.0-1"] = { |
6 | { | 16 | { |
@@ -21,6 +31,19 @@ repository = { | |||
21 | } | 31 | } |
22 | } | 32 | } |
23 | }, | 33 | }, |
34 | has_build_dep = { | ||
35 | ["1.0-1"] = { | ||
36 | { | ||
37 | arch = "rockspec" | ||
38 | }, | ||
39 | { | ||
40 | arch = "src" | ||
41 | }, | ||
42 | { | ||
43 | arch = "all" | ||
44 | } | ||
45 | } | ||
46 | }, | ||
24 | has_namespaced_dep = { | 47 | has_namespaced_dep = { |
25 | ["1.0-1"] = { | 48 | ["1.0-1"] = { |
26 | { | 49 | { |
diff --git a/spec/fixtures/a_repo/manifest-5.1 b/spec/fixtures/a_repo/manifest-5.1 index 141dafb5..1a5f8d55 100644 --- a/spec/fixtures/a_repo/manifest-5.1 +++ b/spec/fixtures/a_repo/manifest-5.1 | |||
@@ -1,6 +1,16 @@ | |||
1 | commands = {} | 1 | commands = {} |
2 | modules = {} | 2 | modules = {} |
3 | repository = { | 3 | repository = { |
4 | a_build_dep = { | ||
5 | ["1.0-1"] = { | ||
6 | { | ||
7 | arch = "src" | ||
8 | }, | ||
9 | { | ||
10 | arch = "rockspec" | ||
11 | } | ||
12 | } | ||
13 | }, | ||
4 | a_rock = { | 14 | a_rock = { |
5 | ["1.0-1"] = { | 15 | ["1.0-1"] = { |
6 | { | 16 | { |
@@ -21,6 +31,19 @@ repository = { | |||
21 | } | 31 | } |
22 | } | 32 | } |
23 | }, | 33 | }, |
34 | has_build_dep = { | ||
35 | ["1.0-1"] = { | ||
36 | { | ||
37 | arch = "rockspec" | ||
38 | }, | ||
39 | { | ||
40 | arch = "src" | ||
41 | }, | ||
42 | { | ||
43 | arch = "all" | ||
44 | } | ||
45 | } | ||
46 | }, | ||
24 | has_namespaced_dep = { | 47 | has_namespaced_dep = { |
25 | ["1.0-1"] = { | 48 | ["1.0-1"] = { |
26 | { | 49 | { |
diff --git a/spec/fixtures/a_repo/manifest-5.2 b/spec/fixtures/a_repo/manifest-5.2 index 141dafb5..1a5f8d55 100644 --- a/spec/fixtures/a_repo/manifest-5.2 +++ b/spec/fixtures/a_repo/manifest-5.2 | |||
@@ -1,6 +1,16 @@ | |||
1 | commands = {} | 1 | commands = {} |
2 | modules = {} | 2 | modules = {} |
3 | repository = { | 3 | repository = { |
4 | a_build_dep = { | ||
5 | ["1.0-1"] = { | ||
6 | { | ||
7 | arch = "src" | ||
8 | }, | ||
9 | { | ||
10 | arch = "rockspec" | ||
11 | } | ||
12 | } | ||
13 | }, | ||
4 | a_rock = { | 14 | a_rock = { |
5 | ["1.0-1"] = { | 15 | ["1.0-1"] = { |
6 | { | 16 | { |
@@ -21,6 +31,19 @@ repository = { | |||
21 | } | 31 | } |
22 | } | 32 | } |
23 | }, | 33 | }, |
34 | has_build_dep = { | ||
35 | ["1.0-1"] = { | ||
36 | { | ||
37 | arch = "rockspec" | ||
38 | }, | ||
39 | { | ||
40 | arch = "src" | ||
41 | }, | ||
42 | { | ||
43 | arch = "all" | ||
44 | } | ||
45 | } | ||
46 | }, | ||
24 | has_namespaced_dep = { | 47 | has_namespaced_dep = { |
25 | ["1.0-1"] = { | 48 | ["1.0-1"] = { |
26 | { | 49 | { |
diff --git a/spec/fixtures/a_repo/manifest-5.3 b/spec/fixtures/a_repo/manifest-5.3 index 141dafb5..1a5f8d55 100644 --- a/spec/fixtures/a_repo/manifest-5.3 +++ b/spec/fixtures/a_repo/manifest-5.3 | |||
@@ -1,6 +1,16 @@ | |||
1 | commands = {} | 1 | commands = {} |
2 | modules = {} | 2 | modules = {} |
3 | repository = { | 3 | repository = { |
4 | a_build_dep = { | ||
5 | ["1.0-1"] = { | ||
6 | { | ||
7 | arch = "src" | ||
8 | }, | ||
9 | { | ||
10 | arch = "rockspec" | ||
11 | } | ||
12 | } | ||
13 | }, | ||
4 | a_rock = { | 14 | a_rock = { |
5 | ["1.0-1"] = { | 15 | ["1.0-1"] = { |
6 | { | 16 | { |
@@ -21,6 +31,19 @@ repository = { | |||
21 | } | 31 | } |
22 | } | 32 | } |
23 | }, | 33 | }, |
34 | has_build_dep = { | ||
35 | ["1.0-1"] = { | ||
36 | { | ||
37 | arch = "rockspec" | ||
38 | }, | ||
39 | { | ||
40 | arch = "src" | ||
41 | }, | ||
42 | { | ||
43 | arch = "all" | ||
44 | } | ||
45 | } | ||
46 | }, | ||
24 | has_namespaced_dep = { | 47 | has_namespaced_dep = { |
25 | ["1.0-1"] = { | 48 | ["1.0-1"] = { |
26 | { | 49 | { |
diff --git a/spec/install_spec.lua b/spec/install_spec.lua index 4043af35..b4273692 100644 --- a/spec/install_spec.lua +++ b/spec/install_spec.lua | |||
@@ -223,4 +223,13 @@ describe("luarocks install #blackbox #b_install", function() | |||
223 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/say/1.0-1")) | 223 | assert.is.truthy(lfs.attributes(testing_paths.testing_sys_rocks .. "/say/1.0-1")) |
224 | end) | 224 | end) |
225 | end) | 225 | end) |
226 | |||
227 | describe("#build_dependencies", function() | ||
228 | it("install does not install a build dependency", function() | ||
229 | assert(run.luarocks_bool("install has_build_dep --server=" .. testing_paths.fixtures_dir .. "/a_repo" )) | ||
230 | assert(run.luarocks_bool("show has_build_dep 1.0")) | ||
231 | assert.falsy(run.luarocks_bool("show a_build_dep 1.0")) | ||
232 | end) | ||
233 | end) | ||
234 | |||
226 | end) | 235 | end) |