@@ -42,7 +42,10 @@ local function stop()
42
42
runningtestname = nil
43
43
callAll (" stop" )
44
44
end
45
+ -- These mod names will remain in __modname__ format, rather than being translated
45
46
local nopathmods = {level = true ,base = true ,core = true }
47
+ -- These mods will be omitted from output entirely
48
+ local ignoremods = {coverage = true }
46
49
local function report ()
47
50
if runningtestname then stop () end
48
51
local moddumps = callAll (" dump" )
@@ -51,40 +54,42 @@ local function report()
51
54
for dumpname ,dump in pairs (moddumps ) do
52
55
for testname ,files in pairs (dump .tests ) do
53
56
for file ,lines in pairs (files ) do
54
- outlines [# outlines + 1 ] = string.format (" TN:%s [%s]\n " ,testname ,dumpname )
55
57
local modname ,filename = file :match (" __(.+)__/(.+)" )
56
- if not modname then
57
- -- startup tracing sometimes gives absolute path of the scenario script, turn it back into the usual form...
58
- filename = file :match (" currently%-playing/(.+)" )
59
- if filename then
60
- modname = " level"
58
+ if not ignoremods [modname ] then
59
+ outlines [# outlines + 1 ] = string.format (" TN:%s [%s]\n " ,testname ,dumpname )
60
+ if not modname then
61
+ -- startup tracing sometimes gives absolute path of the scenario script, turn it back into the usual form...
62
+ filename = file :match (" currently%-playing/(.+)" )
63
+ if filename then
64
+ modname = " level"
65
+ end
61
66
end
62
- end
63
- -- scenario scripts may provide hints to where they came from...
64
- if modname == " level" then
65
- local level = moddumps . level
66
- local levelpath = level and level . levelpath
67
- if levelpath then
68
- modname = levelpath .modname
69
- filename = levelpath . basepath .. filename
67
+ -- scenario scripts may provide hints to where they came from...
68
+ if modname == " level " then
69
+ local level = moddumps . level
70
+ local levelpath = level and level . levelpath
71
+ if levelpath then
72
+ modname = levelpath . modname
73
+ filename = levelpath .basepath .. filename
74
+ end
70
75
end
76
+ if nopathmods [modname ] then
77
+ -- we *still* can't identify level properly, so just give up...
78
+ -- also, we can't create proper paths for core/base anyway
79
+ outlines [# outlines + 1 ] = string.format (" SF:__%s__/%s\n " ,modname ,filename )
80
+ elseif modname == nil then
81
+ -- something totally unrecognized?
82
+ outlines [# outlines + 1 ] = string.format (" SF:%s\n " ,file )
83
+ else
84
+ -- we found it! This will be a path relative to the `mods` directory.
85
+ local modver = game .active_mods [modname ]
86
+ outlines [# outlines + 1 ] = string.format (" SF:./%s_%s/%s\n " ,modname ,modver ,filename )
87
+ end
88
+ for line ,count in pairs (lines ) do
89
+ outlines [# outlines + 1 ] = string.format (" DA:%d,%d\n " ,line ,count )
90
+ end
91
+ outlines [# outlines + 1 ] = " end_of_record\n "
71
92
end
72
- if nopathmods [modname ] then
73
- -- we *still* can't identify level properly, so just give up...
74
- -- also, we can't create proper paths for core/base anyway
75
- outlines [# outlines + 1 ] = string.format (" SF:__%s__/%s\n " ,modname ,filename )
76
- elseif modname == nil then
77
- -- something totally unrecognized?
78
- outlines [# outlines + 1 ] = string.format (" SF:%s\n " ,file )
79
- else
80
- -- we found it! This will be a path relative to the `mods` directory.
81
- local modver = game .active_mods [modname ]
82
- outlines [# outlines + 1 ] = string.format (" SF:./%s_%s/%s\n " ,modname ,modver ,filename )
83
- end
84
- for line ,count in pairs (lines ) do
85
- outlines [# outlines + 1 ] = string.format (" DA:%d,%d\n " ,line ,count )
86
- end
87
- outlines [# outlines + 1 ] = " end_of_record\n "
88
93
end
89
94
end
90
95
end
0 commit comments