aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2017-11-06 18:11:38 -0200
committerHisham Muhammad <hisham@gobolinux.org>2017-11-06 18:26:32 -0200
commit9c7e9fed578b58fff14e7a3dd95bdad62ff6ab31 (patch)
treecaf5be2af131c535b3f9901cd379f08dcf0d3752 /test
parentc9d9487e9e21fb2454b4c7f89494299b7473b0d1 (diff)
downloadluarocks-9c7e9fed578b58fff14e7a3dd95bdad62ff6ab31.tar.gz
luarocks-9c7e9fed578b58fff14e7a3dd95bdad62ff6ab31.tar.bz2
luarocks-9c7e9fed578b58fff14e7a3dd95bdad62ff6ab31.zip
Tests: build using INCDIR for an external dependency
Diffstat (limited to 'test')
-rw-r--r--test/testfiles/with_external_dep-0.1-1.rockspec25
-rw-r--r--test/testfiles/with_external_dep.c10
-rw-r--r--test/testfiles/with_external_dep/foo/foo.h1
-rw-r--r--test/testfiles/with_external_dep/foo/foo.h.gchbin0 -> 1503664 bytes
4 files changed, 36 insertions, 0 deletions
diff --git a/test/testfiles/with_external_dep-0.1-1.rockspec b/test/testfiles/with_external_dep-0.1-1.rockspec
new file mode 100644
index 00000000..45fea4bd
--- /dev/null
+++ b/test/testfiles/with_external_dep-0.1-1.rockspec
@@ -0,0 +1,25 @@
1package = "with_external_dep"
2version = "0.1-1"
3source = {
4 url = "http://localhost:8080/file/with_external_dep.c"
5}
6description = {
7 summary = "An example rockspec",
8}
9external_dependencies = {
10 FOO = {
11 header = "foo/foo.h"
12 }
13}
14dependencies = {
15 "lua >= 5.1"
16}
17build = {
18 type = "builtin",
19 modules = {
20 with_external_dep = {
21 sources = "with_external_dep.c",
22 incdirs = "$(FOO_INCDIR)",
23 }
24 }
25}
diff --git a/test/testfiles/with_external_dep.c b/test/testfiles/with_external_dep.c
new file mode 100644
index 00000000..16435d8f
--- /dev/null
+++ b/test/testfiles/with_external_dep.c
@@ -0,0 +1,10 @@
1#include <foo/foo.h>
2#include <lua.h>
3#include <lauxlib.h>
4
5int luaopen_with_external_dep(lua_State* L) {
6 lua_newtable(L);
7 lua_pushinteger(L, FOO);
8 lua_setfield(L, -2, "foo");
9 return 1;
10}
diff --git a/test/testfiles/with_external_dep/foo/foo.h b/test/testfiles/with_external_dep/foo/foo.h
new file mode 100644
index 00000000..eedd558f
--- /dev/null
+++ b/test/testfiles/with_external_dep/foo/foo.h
@@ -0,0 +1 @@
#define FOO 42
diff --git a/test/testfiles/with_external_dep/foo/foo.h.gch b/test/testfiles/with_external_dep/foo/foo.h.gch
new file mode 100644
index 00000000..66165c9e
--- /dev/null
+++ b/test/testfiles/with_external_dep/foo/foo.h.gch
Binary files differ