From 9c7e9fed578b58fff14e7a3dd95bdad62ff6ab31 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 6 Nov 2017 18:11:38 -0200 Subject: Tests: build using INCDIR for an external dependency --- test/testfiles/with_external_dep-0.1-1.rockspec | 25 ++++++++++++++++++++++++ test/testfiles/with_external_dep.c | 10 ++++++++++ test/testfiles/with_external_dep/foo/foo.h | 1 + test/testfiles/with_external_dep/foo/foo.h.gch | Bin 0 -> 1503664 bytes 4 files changed, 36 insertions(+) create mode 100644 test/testfiles/with_external_dep-0.1-1.rockspec create mode 100644 test/testfiles/with_external_dep.c create mode 100644 test/testfiles/with_external_dep/foo/foo.h create mode 100644 test/testfiles/with_external_dep/foo/foo.h.gch (limited to 'test') 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 @@ +package = "with_external_dep" +version = "0.1-1" +source = { + url = "http://localhost:8080/file/with_external_dep.c" +} +description = { + summary = "An example rockspec", +} +external_dependencies = { + FOO = { + header = "foo/foo.h" + } +} +dependencies = { + "lua >= 5.1" +} +build = { + type = "builtin", + modules = { + with_external_dep = { + sources = "with_external_dep.c", + incdirs = "$(FOO_INCDIR)", + } + } +} 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 @@ +#include +#include +#include + +int luaopen_with_external_dep(lua_State* L) { + lua_newtable(L); + lua_pushinteger(L, FOO); + lua_setfield(L, -2, "foo"); + return 1; +} 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 Binary files /dev/null and b/test/testfiles/with_external_dep/foo/foo.h.gch differ -- cgit v1.2.3-55-g6feb