diff options
-rw-r--r-- | test/test_environment.lua | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/test/test_environment.lua b/test/test_environment.lua index a3ce7ceb..cfbab89b 100644 --- a/test/test_environment.lua +++ b/test/test_environment.lua | |||
@@ -292,9 +292,12 @@ local function make_run_functions() | |||
292 | } | 292 | } |
293 | end | 293 | end |
294 | 294 | ||
295 | --- Build environment for testing | 295 | --- Rebuild environment. |
296 | local function build_environment(env_rocks, testing_paths, env_variables) | 296 | -- Remove old installed rocks and install new ones, |
297 | -- updating manifests and tree copies. | ||
298 | local function build_environment(rocks, env_variables) | ||
297 | title("BUILDING ENVIRONMENT") | 299 | title("BUILDING ENVIRONMENT") |
300 | local testing_paths = test_env.testing_paths | ||
298 | test_env.remove_dir(testing_paths.testing_tree) | 301 | test_env.remove_dir(testing_paths.testing_tree) |
299 | test_env.remove_dir(testing_paths.testing_sys_tree) | 302 | test_env.remove_dir(testing_paths.testing_sys_tree) |
300 | test_env.remove_dir(testing_paths.testing_tree_copy) | 303 | test_env.remove_dir(testing_paths.testing_tree_copy) |
@@ -306,10 +309,11 @@ local function build_environment(env_rocks, testing_paths, env_variables) | |||
306 | test_env.run.luarocks_admin_nocov("make_manifest " .. testing_paths.testing_server) | 309 | test_env.run.luarocks_admin_nocov("make_manifest " .. testing_paths.testing_server) |
307 | test_env.run.luarocks_admin_nocov("make_manifest " .. testing_paths.testing_cache) | 310 | test_env.run.luarocks_admin_nocov("make_manifest " .. testing_paths.testing_cache) |
308 | 311 | ||
309 | for _,package in ipairs(env_rocks) do | 312 | for _, rock in ipairs(rocks) do |
310 | if not test_env.run.luarocks_nocov("install --only-server=" .. testing_paths.testing_cache .. " --tree=" .. testing_paths.testing_sys_tree .. " " .. package, env_variables) then | 313 | if not test_env.run.luarocks_nocov("install --only-server=" .. testing_paths.testing_cache .. " --tree=" .. testing_paths.testing_sys_tree .. " " .. rock, env_variables) then |
311 | test_env.run.luarocks_nocov("build --tree=" .. testing_paths.testing_sys_tree .. " " .. package, env_variables) | 314 | test_env.run.luarocks_nocov("build --tree=" .. testing_paths.testing_sys_tree .. " " .. rock, env_variables) |
312 | test_env.run.luarocks_nocov("pack --tree=" .. testing_paths.testing_sys_tree .. " " .. package .. "; mv " .. package .. "-*.rock " .. testing_paths.testing_cache, env_variables) | 315 | test_env.run.luarocks_nocov("pack --tree=" .. testing_paths.testing_sys_tree .. " " .. rock, env_variables) |
316 | execute_bool("mv " .. rock .. "-*.rock " .. testing_paths.testing_cache) | ||
313 | end | 317 | end |
314 | end | 318 | end |
315 | 319 | ||
@@ -602,7 +606,7 @@ function test_env.main() | |||
602 | lfs.mkdir(testing_paths.testing_server) | 606 | lfs.mkdir(testing_paths.testing_server) |
603 | download_rocks(rocks, testing_paths.testing_server) | 607 | download_rocks(rocks, testing_paths.testing_server) |
604 | 608 | ||
605 | build_environment(env_rocks, testing_paths, install_env_vars) | 609 | build_environment(env_rocks, install_env_vars) |
606 | end | 610 | end |
607 | 611 | ||
608 | test_env.set_lua_version() | 612 | test_env.set_lua_version() |