diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2022-06-06 15:25:47 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2022-06-06 17:14:52 -0300 |
commit | 4ef2c181d9f76d01c1a6b58232e5d0dfe8679bf7 (patch) | |
tree | 84940a904aed7e528e1e51ea3b310b661bbde538 /spec | |
parent | b4b5635130b2cc0c4d29f8cd754bfe3a829ba7ec (diff) | |
download | luarocks-4ef2c181d9f76d01c1a6b58232e5d0dfe8679bf7.tar.gz luarocks-4ef2c181d9f76d01c1a6b58232e5d0dfe8679bf7.tar.bz2 luarocks-4ef2c181d9f76d01c1a6b58232e5d0dfe8679bf7.zip |
tests: accept full path in -Xhelper lua_interpreter
Diffstat (limited to 'spec')
-rw-r--r-- | spec/util/test_env.lua | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index c32e9978..1d67d30d 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua | |||
@@ -654,15 +654,20 @@ local function create_paths(luaversion_full) | |||
654 | testing_paths.lua_interpreter = test_env.LUA_INTERPRETER or "lua" | 654 | testing_paths.lua_interpreter = test_env.LUA_INTERPRETER or "lua" |
655 | end | 655 | end |
656 | 656 | ||
657 | local bindirs = { | 657 | local locations |
658 | testing_paths.luadir .. "/bin", | 658 | if testing_paths.lua_interpreter:match("[/\\]") then |
659 | testing_paths.luadir, | 659 | locations = { testing_paths.lua_interpreter } |
660 | } | 660 | else |
661 | for _, bindir in ipairs(bindirs) do | 661 | locations = { |
662 | local lua = bindir .. "/" .. testing_paths.lua_interpreter | 662 | testing_paths.luadir .. "/bin/" .. testing_paths.lua_interpreter, |
663 | if test_env.exists(lua) then | 663 | testing_paths.luadir .. "/" .. testing_paths.lua_interpreter, |
664 | testing_paths.lua_bindir = bindir | 664 | } |
665 | testing_paths.lua = lua | 665 | end |
666 | |||
667 | for _, location in ipairs(locations) do | ||
668 | if test_env.exists(location) then | ||
669 | testing_paths.lua_bindir = location:match("(.*)[/\\][^/\\]*$") | ||
670 | testing_paths.lua = location | ||
666 | break | 671 | break |
667 | end | 672 | end |
668 | end | 673 | end |