File tree 2 files changed +16
-0
lines changed 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change 23
23
- Fix error trace reporting for functions executed with ` Server:exec() `
24
24
(gh-396 ).
25
25
- Remove pretty-printing of ` luatest.log ` arguments.
26
+ - Fixed calculation of coverage percentage (gh-402 )
26
27
27
28
## 1.0.1
28
29
Original file line number Diff line number Diff line change @@ -29,6 +29,17 @@ local function with_cwd(dir, fn)
29
29
assert (fio .chdir (old ), ' Failed to chdir to ' .. old )
30
30
end
31
31
32
+ local function find_luas (list_of_lua_modules , path )
33
+ for _ , filename in pairs (fio .listdir (path )) do
34
+ local full_filename = fio .pathjoin (path , filename )
35
+ if fio .path .is_dir (full_filename ) then
36
+ find_luas (list_of_lua_modules , full_filename )
37
+ elseif full_filename :endswith (" .lua" ) then
38
+ list_of_lua_modules [full_filename ] = {max = 0 , max_hits = 0 }
39
+ end
40
+ end
41
+ end
42
+
32
43
function export .enable ()
33
44
local root = os.getenv (' LUATEST_LUACOV_ROOT' )
34
45
if not root then
@@ -42,6 +53,10 @@ function export.enable()
42
53
for _ , item in pairs (export .DEFAULT_EXCLUDE ) do
43
54
table.insert (config .exclude , item )
44
55
end
56
+
57
+ runner .data = {}
58
+ find_luas (runner .data , root )
59
+
45
60
runner .init (config )
46
61
end )
47
62
end
You can’t perform that action at this time.
0 commit comments