From 0ca8c460e867356342180bb625760ed9201a5503 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Wed, 28 Feb 2024 22:38:41 -0300 Subject: tests: disable luacov runner tick --- spec/dummy_spec.lua | 2 +- spec/unit/build_spec.lua | 3 +-- spec/unit/deps_spec.lua | 3 +-- spec/unit/dir_spec.lua | 5 ++--- spec/unit/fetch_spec.lua | 5 ++--- spec/unit/fs_spec.lua | 7 +++---- spec/unit/fun_spec.lua | 5 ++--- spec/unit/loader_spec.lua | 7 ++----- spec/unit/persist_spec.lua | 7 +++---- spec/unit/test_spec.lua | 3 +-- spec/unit/tools_spec.lua | 7 +++---- spec/unit/util_spec.lua | 5 ++--- 12 files changed, 23 insertions(+), 36 deletions(-) diff --git a/spec/dummy_spec.lua b/spec/dummy_spec.lua index 85fc8932..9ddd669a 100644 --- a/spec/dummy_spec.lua +++ b/spec/dummy_spec.lua @@ -21,4 +21,4 @@ require("luarocks.fetch.hg") require("luarocks.fetch.sscm") require("luarocks.fetch.svn") -runner.shutdown() +runner.save_stats() diff --git a/spec/unit/build_spec.lua b/spec/unit/build_spec.lua index fb680858..3ef8eece 100644 --- a/spec/unit/build_spec.lua +++ b/spec/unit/build_spec.lua @@ -32,7 +32,6 @@ describe("LuaRocks build #unit", function() lazy_setup(function() runner = require("luacov.runner") runner.init(testing_paths.testrun_dir .. "/luacov.config") - runner.tick = true cfg.init() fs.init() deps.check_lua_incdir(cfg.variables) @@ -40,7 +39,7 @@ describe("LuaRocks build #unit", function() end) lazy_teardown(function() - runner.shutdown() + runner.save_stats() end) describe("build.builtin", function() diff --git a/spec/unit/deps_spec.lua b/spec/unit/deps_spec.lua index b8c89a2d..3be80b91 100644 --- a/spec/unit/deps_spec.lua +++ b/spec/unit/deps_spec.lua @@ -16,11 +16,10 @@ describe("LuaRocks deps #unit", function() runner = require("luacov.runner") runner.init(testing_paths.testrun_dir .. "/luacov.config") - runner.tick = true end) lazy_teardown(function() - runner.shutdown() + runner.save_stats() end) describe("deps", function() diff --git a/spec/unit/dir_spec.lua b/spec/unit/dir_spec.lua index f340beea..da5d6389 100644 --- a/spec/unit/dir_spec.lua +++ b/spec/unit/dir_spec.lua @@ -11,11 +11,10 @@ describe("luarocks.dir #unit", function() setup(function() runner = require("luacov.runner") runner.init(testing_paths.testrun_dir .. "/luacov.config") - runner.tick = true end) - teardown(function() - runner.shutdown() + lazy_teardown(function() + runner.save_stats() end) describe("dir.is_basic_protocol", function() diff --git a/spec/unit/fetch_spec.lua b/spec/unit/fetch_spec.lua index c58e2cea..4fc01d80 100644 --- a/spec/unit/fetch_spec.lua +++ b/spec/unit/fetch_spec.lua @@ -60,11 +60,10 @@ describe("luarocks fetch #unit", function() runner = require("luacov.runner") runner.init(testing_paths.testrun_dir .. "/luacov.config") - runner.tick = true end) - teardown(function() - runner.shutdown() + lazy_teardown(function() + runner.save_stats() end) diff --git a/spec/unit/fs_spec.lua b/spec/unit/fs_spec.lua index 7643e9b5..5718aea4 100644 --- a/spec/unit/fs_spec.lua +++ b/spec/unit/fs_spec.lua @@ -63,16 +63,15 @@ describe("luarocks.fs #unit", function() local runner - setup(function() + lazy_setup(function() cfg.init() fs.init() runner = require("luacov.runner") runner.init(testing_paths.testrun_dir .. "/luacov.config") - runner.tick = true end) - teardown(function() - runner.shutdown() + lazy_teardown(function() + runner.save_stats() end) describe("fs.Q", function() diff --git a/spec/unit/fun_spec.lua b/spec/unit/fun_spec.lua index c2b3e864..d7db1362 100644 --- a/spec/unit/fun_spec.lua +++ b/spec/unit/fun_spec.lua @@ -9,11 +9,10 @@ describe("luarocks.fun #unit", function() setup(function() runner = require("luacov.runner") runner.init(testing_paths.testrun_dir .. "/luacov.config") - runner.tick = true end) - teardown(function() - runner.shutdown() + lazy_teardown(function() + runner.save_stats() end) describe("fun.concat", function() diff --git a/spec/unit/loader_spec.lua b/spec/unit/loader_spec.lua index 7650c80c..cde30590 100644 --- a/spec/unit/loader_spec.lua +++ b/spec/unit/loader_spec.lua @@ -1,12 +1,9 @@ local test_env = require("spec.util.test_env") local run = test_env.run -describe("luarocks.loader", function() - - before_each(function() - test_env.setup_specs() - end) +test_env.setup_specs() +describe("luarocks.loader", function() describe("#unit", function() it("starts", function() assert(run.lua_bool([[-e "require 'luarocks.loader'; print(package.loaded['luarocks.loaded'])"]])) diff --git a/spec/unit/persist_spec.lua b/spec/unit/persist_spec.lua index ea5985aa..ed78345e 100644 --- a/spec/unit/persist_spec.lua +++ b/spec/unit/persist_spec.lua @@ -6,14 +6,13 @@ local persist = require("luarocks.persist") describe("luarocks.persist #unit", function() local runner - setup(function() + lazy_setup(function() runner = require("luacov.runner") runner.init(testing_paths.testrun_dir .. "/luacov.config") - runner.tick = true end) - teardown(function() - runner.shutdown() + lazy_teardown(function() + runner.save_stats() end) describe("persist.save_from_table_to_string", function() diff --git a/spec/unit/test_spec.lua b/spec/unit/test_spec.lua index 4d338984..4a31777e 100644 --- a/spec/unit/test_spec.lua +++ b/spec/unit/test_spec.lua @@ -19,11 +19,10 @@ describe("LuaRocks test #unit", function() fs.init() runner = require("luacov.runner") runner.init(testing_paths.testrun_dir .. "/luacov.config") - runner.tick = true end) lazy_teardown(function() - runner.shutdown() + runner.save_stats() end) local tmpdir diff --git a/spec/unit/tools_spec.lua b/spec/unit/tools_spec.lua index 0863c316..5b85c86a 100644 --- a/spec/unit/tools_spec.lua +++ b/spec/unit/tools_spec.lua @@ -147,16 +147,15 @@ local invalid_patch3 = describe("Luarocks patch test #unit", function() local runner - setup(function() + lazy_setup(function() cfg.init() fs.init() runner = require("luacov.runner") runner.init(testing_paths.testrun_dir .. "/luacov.config") - runner.tick = true end) - teardown(function() - runner.shutdown() + lazy_teardown(function() + runner.save_stats() end) describe("patch.read_patch", function() diff --git a/spec/unit/util_spec.lua b/spec/unit/util_spec.lua index 0e380f2a..bb427b3e 100644 --- a/spec/unit/util_spec.lua +++ b/spec/unit/util_spec.lua @@ -11,11 +11,10 @@ describe("luarocks.util #unit", function() setup(function() runner = require("luacov.runner") runner.init(testing_paths.testrun_dir .. "/luacov.config") - runner.tick = true end) - teardown(function() - runner.shutdown() + lazy_teardown(function() + runner.save_stats() end) describe("util.variable_substitutions", function() -- cgit v1.2.3-55-g6feb