diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-27 10:55:16 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-07-01 21:32:39 -0300 |
commit | 9404d59d48a511983ed30a6d0f605041a74ff332 (patch) | |
tree | 920340b4b019a2dff9c7eeaeab01314af386b547 /spec | |
parent | b7680a66385dde34c8e8dbdeafc22156425cb38c (diff) | |
download | luarocks-9404d59d48a511983ed30a6d0f605041a74ff332.tar.gz luarocks-9404d59d48a511983ed30a6d0f605041a74ff332.tar.bz2 luarocks-9404d59d48a511983ed30a6d0f605041a74ff332.zip |
Let LuaRocks find LUA_LIBDIR and LUA_INCDIR by itself
Diffstat (limited to 'spec')
-rw-r--r-- | spec/config_spec.lua | 8 | ||||
-rw-r--r-- | spec/util/test_env.lua | 10 |
2 files changed, 4 insertions, 14 deletions
diff --git a/spec/config_spec.lua b/spec/config_spec.lua index 825245b7..f415909d 100644 --- a/spec/config_spec.lua +++ b/spec/config_spec.lua | |||
@@ -20,14 +20,14 @@ describe("LuaRocks config tests #integration", function() | |||
20 | assert.match("rocks_servers", run.luarocks("config")) | 20 | assert.match("rocks_servers", run.luarocks("config")) |
21 | end) | 21 | end) |
22 | 22 | ||
23 | it("LuaRocks config include dir", function() | 23 | it("LuaRocks config include dir returns a subdir of LUA_DIR", function() |
24 | local output = run.luarocks("config --lua-incdir") | 24 | local output = run.luarocks("config --lua-incdir") |
25 | assert.are.same(hardcoded.LUA_INCDIR, output) | 25 | assert.match(hardcoded.LUA_DIR, output, 1, true) |
26 | end) | 26 | end) |
27 | 27 | ||
28 | it("LuaRocks config library dir", function() | 28 | it("LuaRocks config library dir returns a subdir of LUA_DIR", function() |
29 | local output = run.luarocks("config --lua-libdir") | 29 | local output = run.luarocks("config --lua-libdir") |
30 | assert.are.same(hardcoded.LUA_LIBDIR, output) | 30 | assert.match(hardcoded.LUA_DIR, output, 1, true) |
31 | end) | 31 | end) |
32 | 32 | ||
33 | it("LuaRocks config lua version", function() | 33 | it("LuaRocks config lua version", function() |
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index fc292607..60162ee3 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua | |||
@@ -547,14 +547,6 @@ local function create_paths(luaversion_full) | |||
547 | end | 547 | end |
548 | assert(testing_paths.lua, "Lua interpreter not found! Run `busted -Xhelper help` for options") | 548 | assert(testing_paths.lua, "Lua interpreter not found! Run `busted -Xhelper help` for options") |
549 | 549 | ||
550 | local incfile = test_env.file_if_exists(testing_paths.luadir .. "/include/lua/" .. test_env.lua_version .. "/lua.h") | ||
551 | or test_env.file_if_exists(testing_paths.luadir .. "/include/lua" .. test_env.lua_version .. "/lua.h") | ||
552 | or test_env.file_if_exists(testing_paths.luadir .. "/include/lua.h") | ||
553 | testing_paths.lua_incdir = assert(incfile, "Lua header lua.h not found!"):gsub("/lua.h$", "") | ||
554 | |||
555 | testing_paths.lua_libdir = test_env.file_if_exists(testing_paths.luadir .. "/lib") | ||
556 | or test_env.file_if_exists(testing_paths.luadir) | ||
557 | |||
558 | local base_dir = lfs.currentdir() | 550 | local base_dir = lfs.currentdir() |
559 | 551 | ||
560 | if test_env.TEST_TARGET_OS == "windows" then | 552 | if test_env.TEST_TARGET_OS == "windows" then |
@@ -770,8 +762,6 @@ local function setup_luarocks() | |||
770 | "return {", | 762 | "return {", |
771 | ("SYSCONFDIR = %q,"):format(testing_paths.testing_lrprefix .. "/etc/luarocks"), | 763 | ("SYSCONFDIR = %q,"):format(testing_paths.testing_lrprefix .. "/etc/luarocks"), |
772 | ("LUA_DIR = %q,"):format(testing_paths.luadir), | 764 | ("LUA_DIR = %q,"):format(testing_paths.luadir), |
773 | ("LUA_INCDIR = %q,"):format(testing_paths.lua_incdir), | ||
774 | ("LUA_LIBDIR = %q,"):format(testing_paths.lua_libdir), | ||
775 | ("LUA_BINDIR = %q,"):format(testing_paths.lua_bindir), | 765 | ("LUA_BINDIR = %q,"):format(testing_paths.lua_bindir), |
776 | ("LUA_INTERPRETER = %q,"):format(testing_paths.lua_interpreter), | 766 | ("LUA_INTERPRETER = %q,"):format(testing_paths.lua_interpreter), |
777 | } | 767 | } |