diff options
| author | George Roman <george.roman.99@gmail.com> | 2018-06-10 23:41:32 +0300 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-06-12 15:23:31 -0300 |
| commit | 9f00925a3d5e70350ad73d908d99c8ef634dc7eb (patch) | |
| tree | 7cf909d742bd4f07b6207d4d54adc723250b8b1d | |
| parent | 1fb1a5668a87e80c6eb7fe54e8b9fa8b1ef5851f (diff) | |
| download | luarocks-9f00925a3d5e70350ad73d908d99c8ef634dc7eb.tar.gz luarocks-9f00925a3d5e70350ad73d908d99c8ef634dc7eb.tar.bz2 luarocks-9f00925a3d5e70350ad73d908d99c8ef634dc7eb.zip | |
Fix the collecting of coverage data from unit tests
| -rw-r--r-- | spec/dir_spec.lua | 12 | ||||
| -rw-r--r-- | spec/fetch_spec.lua | 3 | ||||
| -rw-r--r-- | spec/fs_spec.lua | 3 | ||||
| -rw-r--r-- | spec/fun_spec.lua | 1 | ||||
| -rw-r--r-- | spec/persist_spec.lua | 1 | ||||
| -rw-r--r-- | spec/util_spec.lua | 1 |
6 files changed, 19 insertions, 2 deletions
diff --git a/spec/dir_spec.lua b/spec/dir_spec.lua index 27966777..08fb6e23 100644 --- a/spec/dir_spec.lua +++ b/spec/dir_spec.lua | |||
| @@ -1,10 +1,22 @@ | |||
| 1 | local test_env = require("spec.util.test_env") | 1 | local test_env = require("spec.util.test_env") |
| 2 | local testing_paths = test_env.testing_paths | ||
| 2 | 3 | ||
| 3 | test_env.unload_luarocks() | 4 | test_env.unload_luarocks() |
| 4 | test_env.setup_specs() | 5 | test_env.setup_specs() |
| 5 | local dir = require("luarocks.dir") | 6 | local dir = require("luarocks.dir") |
| 6 | 7 | ||
| 7 | describe("Luarocks dir test #unit", function() | 8 | describe("Luarocks dir test #unit", function() |
| 9 | local runner | ||
| 10 | |||
| 11 | setup(function() | ||
| 12 | runner = require("luacov.runner") | ||
| 13 | runner.init(testing_paths.testrun_dir .. "/luacov.config") | ||
| 14 | runner.tick = true | ||
| 15 | end) | ||
| 16 | |||
| 17 | teardown(function() | ||
| 18 | runner.shutdown() | ||
| 19 | end) | ||
| 8 | 20 | ||
| 9 | describe("dir.is_basic_protocol", function() | 21 | describe("dir.is_basic_protocol", function() |
| 10 | it("checks whether the arguments represent a valid protocol and returns the result of the check", function() | 22 | it("checks whether the arguments represent a valid protocol and returns the result of the check", function() |
diff --git a/spec/fetch_spec.lua b/spec/fetch_spec.lua index aa107970..3564bffe 100644 --- a/spec/fetch_spec.lua +++ b/spec/fetch_spec.lua | |||
| @@ -9,7 +9,7 @@ local lfs = require("lfs") | |||
| 9 | local testing_paths = test_env.testing_paths | 9 | local testing_paths = test_env.testing_paths |
| 10 | local get_tmp_path = test_env.get_tmp_path | 10 | local get_tmp_path = test_env.get_tmp_path |
| 11 | 11 | ||
| 12 | describe("Luarocks fetch test #unit", function() | 12 | describe("Luarocks fetch test #unit", function() |
| 13 | local are_same_files = function(file1, file2) | 13 | local are_same_files = function(file1, file2) |
| 14 | return file1 == file2 or lfs.attributes(file1).ino == lfs.attributes(file2).ino | 14 | return file1 == file2 or lfs.attributes(file1).ino == lfs.attributes(file2).ino |
| 15 | end | 15 | end |
| @@ -19,6 +19,7 @@ describe("Luarocks fetch test #unit", function() | |||
| 19 | setup(function() | 19 | setup(function() |
| 20 | runner = require("luacov.runner") | 20 | runner = require("luacov.runner") |
| 21 | runner.init(testing_paths.testrun_dir .. "/luacov.config") | 21 | runner.init(testing_paths.testrun_dir .. "/luacov.config") |
| 22 | runner.tick = true | ||
| 22 | end) | 23 | end) |
| 23 | 24 | ||
| 24 | teardown(function() | 25 | teardown(function() |
diff --git a/spec/fs_spec.lua b/spec/fs_spec.lua index e09ac6df..f1529c39 100644 --- a/spec/fs_spec.lua +++ b/spec/fs_spec.lua | |||
| @@ -9,7 +9,7 @@ local posix_ok = pcall(require, "posix") | |||
| 9 | local testing_paths = test_env.testing_paths | 9 | local testing_paths = test_env.testing_paths |
| 10 | local get_tmp_path = test_env.get_tmp_path | 10 | local get_tmp_path = test_env.get_tmp_path |
| 11 | 11 | ||
| 12 | describe("Luarocks fs test #unit", function() | 12 | describe("Luarocks fs test #unit", function() |
| 13 | local exists_file = function(path) | 13 | local exists_file = function(path) |
| 14 | local ok, err, code = os.rename(path, path) | 14 | local ok, err, code = os.rename(path, path) |
| 15 | if not ok and code == 13 then | 15 | if not ok and code == 13 then |
| @@ -56,6 +56,7 @@ describe("Luarocks fs test #unit", function() | |||
| 56 | setup(function() | 56 | setup(function() |
| 57 | runner = require("luacov.runner") | 57 | runner = require("luacov.runner") |
| 58 | runner.init(testing_paths.testrun_dir .. "/luacov.config") | 58 | runner.init(testing_paths.testrun_dir .. "/luacov.config") |
| 59 | runner.tick = true | ||
| 59 | end) | 60 | end) |
| 60 | 61 | ||
| 61 | teardown(function() | 62 | teardown(function() |
diff --git a/spec/fun_spec.lua b/spec/fun_spec.lua index b0a082ac..fe945921 100644 --- a/spec/fun_spec.lua +++ b/spec/fun_spec.lua | |||
| @@ -10,6 +10,7 @@ describe("LuaRocks fun tests #unit", function() | |||
| 10 | setup(function() | 10 | setup(function() |
| 11 | runner = require("luacov.runner") | 11 | runner = require("luacov.runner") |
| 12 | runner.init(testing_paths.testrun_dir .. "/luacov.config") | 12 | runner.init(testing_paths.testrun_dir .. "/luacov.config") |
| 13 | runner.tick = true | ||
| 13 | end) | 14 | end) |
| 14 | 15 | ||
| 15 | teardown(function() | 16 | teardown(function() |
diff --git a/spec/persist_spec.lua b/spec/persist_spec.lua index 339147b1..dccb0ec4 100644 --- a/spec/persist_spec.lua +++ b/spec/persist_spec.lua | |||
| @@ -10,6 +10,7 @@ describe("Luarocks persist test #unit", function() | |||
| 10 | setup(function() | 10 | setup(function() |
| 11 | runner = require("luacov.runner") | 11 | runner = require("luacov.runner") |
| 12 | runner.init(testing_paths.testrun_dir .. "/luacov.config") | 12 | runner.init(testing_paths.testrun_dir .. "/luacov.config") |
| 13 | runner.tick = true | ||
| 13 | end) | 14 | end) |
| 14 | 15 | ||
| 15 | teardown(function() | 16 | teardown(function() |
diff --git a/spec/util_spec.lua b/spec/util_spec.lua index 3bb97a5b..26e93e14 100644 --- a/spec/util_spec.lua +++ b/spec/util_spec.lua | |||
| @@ -79,6 +79,7 @@ describe("Luarocks util test #unit", function() | |||
| 79 | setup(function() | 79 | setup(function() |
| 80 | runner = require("luacov.runner") | 80 | runner = require("luacov.runner") |
| 81 | runner.init(testing_paths.testrun_dir .. "/luacov.config") | 81 | runner.init(testing_paths.testrun_dir .. "/luacov.config") |
| 82 | runner.tick = true | ||
| 82 | end) | 83 | end) |
| 83 | 84 | ||
| 84 | teardown(function() | 85 | teardown(function() |
