diff options
| author | Peter Melnichenko <mpeterval@gmail.com> | 2016-07-08 20:28:43 +0300 |
|---|---|---|
| committer | Peter Melnichenko <mpeterval@gmail.com> | 2016-07-08 20:28:43 +0300 |
| commit | a05ba7ce42ae4e42f80b5cacdd8770ae5e6cc04b (patch) | |
| tree | aeaf8c1886c949e8e357b59a04cebc3be3930bce | |
| parent | 09315362c8c1eb78311586247ddd46f1add1aae6 (diff) | |
| download | luarocks-a05ba7ce42ae4e42f80b5cacdd8770ae5e6cc04b.tar.gz luarocks-a05ba7ce42ae4e42f80b5cacdd8770ae5e6cc04b.tar.bz2 luarocks-a05ba7ce42ae4e42f80b5cacdd8770ae5e6cc04b.zip | |
Infer Lua version using luarocks.cfg when not on travis
| -rw-r--r-- | test/test_environment.lua | 32 |
1 files changed, 6 insertions, 26 deletions
diff --git a/test/test_environment.lua b/test/test_environment.lua index a48a59a3..6de7a4e2 100644 --- a/test/test_environment.lua +++ b/test/test_environment.lua | |||
| @@ -7,9 +7,8 @@ LuaRocks test-suite | |||
| 7 | INFORMATION | 7 | INFORMATION |
| 8 | New test-suite for LuaRocks project, using unit testing framework Busted. | 8 | New test-suite for LuaRocks project, using unit testing framework Busted. |
| 9 | REQUIREMENTS | 9 | REQUIREMENTS |
| 10 | Tests require to have Lua installed and added to PATH. Be sure sshd is | 10 | Be sure sshd is running on your system, or use '--exclude-tags=ssh', |
| 11 | running on your system, or use '--exclude-tags=ssh', to not execute tests | 11 | to not execute tests which require sshd. |
| 12 | which require sshd. | ||
| 13 | USAGE | 12 | USAGE |
| 14 | busted [-Xhelper <arguments>] | 13 | busted [-Xhelper <arguments>] |
| 15 | ARGUMENTS | 14 | ARGUMENTS |
| @@ -343,30 +342,11 @@ local function reset_environment(testing_paths, md5sums) | |||
| 343 | end | 342 | end |
| 344 | 343 | ||
| 345 | local function create_paths(luaversion_full) | 344 | local function create_paths(luaversion_full) |
| 346 | local testing_paths = {} | 345 | local cfg = require("luarocks.cfg") |
| 347 | 346 | ||
| 348 | testing_paths.luadir = "" | 347 | local testing_paths = {} |
| 349 | 348 | testing_paths.luadir = cfg.variables.LUA_BINDIR:gsub("/bin/?$", "") | |
| 350 | if test_env.TRAVIS then | 349 | testing_paths.lua = cfg.variables.LUA_BINDIR .. "/" .. cfg.lua_interpreter |
| 351 | testing_paths.luadir = lfs.currentdir() .. "/lua_install" | ||
| 352 | testing_paths.lua = testing_paths.luadir .. "/bin/lua" | ||
| 353 | elseif test_env.LUA_V then | ||
| 354 | if exists("/usr/bin/lua") then | ||
| 355 | testing_paths.luadir = "/usr" | ||
| 356 | testing_paths.lua = testing_paths.luadir .. "/bin/lua" | ||
| 357 | elseif exists("/usr/local/bin/lua") then | ||
| 358 | testing_paths.luadir = "/usr/local" | ||
| 359 | testing_paths.lua = testing_paths.luadir .. "/bin/lua" | ||
| 360 | end | ||
| 361 | elseif test_env.LUAJIT_V then | ||
| 362 | if exists("/usr/bin/luajit") then | ||
| 363 | testing_paths.luadir = "/usr" | ||
| 364 | testing_paths.lua = testing_paths.luadir .. "/bin/luajit" | ||
| 365 | elseif exists("/usr/local/bin/luajit") then | ||
| 366 | testing_paths.luadir = "/usr/local" | ||
| 367 | testing_paths.lua = testing_paths.luadir .. "/bin/luajit" | ||
| 368 | end | ||
| 369 | end | ||
| 370 | 350 | ||
| 371 | testing_paths.luarocks_tmp = "/tmp/luarocks_testing" --windows? | 351 | testing_paths.luarocks_tmp = "/tmp/luarocks_testing" --windows? |
| 372 | 352 | ||
