From f056938237f82845e9d3b4924cac483a4bbb7b20 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 25 Jun 2018 12:06:26 -0300 Subject: Tests: try some smarter defaults for Windows --- spec/util/test_env.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/util/test_env.lua b/spec/util/test_env.lua index 22a2ad41..0491f90f 100644 --- a/spec/util/test_env.lua +++ b/spec/util/test_env.lua @@ -523,15 +523,18 @@ end local function create_paths(luaversion_full) local testing_paths = {} - testing_paths.luadir = (test_env.LUA_DIR or "/usr/local") - testing_paths.lua = testing_paths.luadir .. "/bin/" .. (test_env.LUA_INTERPRETER or "lua") - if test_env.TEST_TARGET_OS == "windows" then + testing_paths.luadir = (test_env.LUA_DIR or os.getenv("ProgramFiles(x86)").."/LuaRocks") testing_paths.luarocks_tmp = os.getenv("TEMP") else + testing_paths.luadir = (test_env.LUA_DIR or "/usr/local") testing_paths.luarocks_tmp = "/tmp/luarocks_testing" end + testing_paths.lua = test_env.file_if_exists(testing_paths.luadir .. "/bin/" .. (test_env.LUA_INTERPRETER or "lua")) + or test_env.file_if_exists(testing_paths.luadir .. "/" .. (test_env.LUA_INTERPRETER or "lua")) + assert(testing_paths.lua, "Lua interpreter not found! Run `busted -Xhelper help` for options") + local base_dir = lfs.currentdir() if test_env.TEST_TARGET_OS == "windows" then -- cgit v1.2.3-55-g6feb