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
77{
88 public static class CoverageTracker
99 {
10- private static List < string > _markers ;
11- private static string _path ;
10+ private static Dictionary < string , List < string > > _markers ;
1211 private static bool _registered ;
1312
1413 [ ExcludeFromCoverage ]
1514 public static void MarkExecuted ( string path , string marker )
1615 {
1716 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+ }
1925
2026 if ( ! _registered )
2127 {
2228 AppDomain . CurrentDomain . ProcessExit += new EventHandler ( CurrentDomain_ProcessExit ) ;
2329 _registered = true ;
2430 }
2531
26- _markers . Add ( marker ) ;
27- _path = path ;
32+ _markers [ path ] . Add ( marker ) ;
2833 }
2934
3035 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+ }
3242 }
3343}
You can’t perform that action at this time.
0 commit comments