diff options
| -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 |
