File tree Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Expand file tree Collapse file tree 1 file changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -7,27 +7,37 @@ namespace Coverlet.Core
7
7
{
8
8
public static class CoverageTracker
9
9
{
10
- private static List < string > _markers ;
11
- private static string _path ;
10
+ private static Dictionary < string , List < string > > _markers ;
12
11
private static bool _registered ;
13
12
14
13
[ ExcludeFromCoverage ]
15
14
public static void MarkExecuted ( string path , string marker )
16
15
{
17
16
if ( _markers == null )
18
- _markers = new List < string > ( ) ;
17
+ {
18
+ _markers = new Dictionary < string , List < string > > ( ) ;
19
+ }
20
+
21
+ if ( ! _markers . ContainsKey ( path ) )
22
+ {
23
+ _markers . Add ( path , new List < string > ( ) ) ;
24
+ }
19
25
20
26
if ( ! _registered )
21
27
{
22
28
AppDomain . CurrentDomain . ProcessExit += new EventHandler ( CurrentDomain_ProcessExit ) ;
23
29
_registered = true ;
24
30
}
25
31
26
- _markers . Add ( marker ) ;
27
- _path = path ;
32
+ _markers [ path ] . Add ( marker ) ;
28
33
}
29
34
30
35
public static void CurrentDomain_ProcessExit ( object sender , EventArgs e )
31
- => File . WriteAllLines ( _path , _markers ) ;
36
+ {
37
+ foreach ( var kvp in _markers )
38
+ {
39
+ File . WriteAllLines ( kvp . Key , kvp . Value ) ;
40
+ }
41
+ }
32
42
}
33
43
}
You can’t perform that action at this time.
0 commit comments