Skip to content

Commit f33e5cd

Browse files
daveMuellerDavid Mueller IWS
authored andcommitted
changed test
1 parent ec2bc85 commit f33e5cd

File tree

11 files changed

+36
-102
lines changed

11 files changed

+36
-102
lines changed

Documentation/Changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## Unreleased
8+
9+
### Fixed
10+
-Fix problem with coverage for .net5 WPF application [#1221](https://github.com/coverlet-coverage/coverlet/issues/1221) by https://github.com/lg2de
11+
-Fix unable to instrument module for Microsoft.AspNetCore.Mvc.Razor [#1459](https://github.com/coverlet-coverage/coverlet/issues/1459) by https://github.com/lg2de
12+
713
## Release date 2023-05-21
814
### Packages
915
coverlet.msbuild 6.0.0

src/coverlet.core/Instrumentation/CecilAssemblyResolver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ public NetstandardAwareAssemblyResolver(string modulePath, ILogger logger)
7777
_compositeResolver = new Lazy<CompositeCompilationAssemblyResolver>(() => new CompositeCompilationAssemblyResolver(new ICompilationAssemblyResolver[]
7878
{
7979
new AppBaseCompilationAssemblyResolver(),
80-
new PackageCompilationAssemblyResolver(),
8180
new NetCoreSharedFrameworkResolver(modulePath, _logger),
8281
new ReferenceAssemblyPathResolver(),
82+
new PackageCompilationAssemblyResolver(),
8383
}), true);
8484
}
8585

test/coverlet.core.tests/Instrumentation/ModuleTrackerTemplateTests.cs

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -123,26 +123,24 @@ public void MutexBlocksMultipleWriters()
123123
FunctionExecutor.Run(async () =>
124124
{
125125
using var ctx = new TrackerContext();
126-
using (var mutex = new Mutex(
127-
true, Path.GetFileNameWithoutExtension(ModuleTrackerTemplate.HitsFilePath) + "_Mutex", out bool createdNew))
128-
{
129-
Assert.True(createdNew);
126+
using var mutex = new Mutex(
127+
true, Path.GetFileNameWithoutExtension(ModuleTrackerTemplate.HitsFilePath) + "_Mutex", out bool createdNew);
128+
Assert.True(createdNew);
130129

131-
ModuleTrackerTemplate.HitsArray = new[] { 0, 1, 2, 3 };
132-
var unloadTask = Task.Run(() => ModuleTrackerTemplate.UnloadModule(null, null));
130+
ModuleTrackerTemplate.HitsArray = new[] { 0, 1, 2, 3 };
131+
var unloadTask = Task.Run(() => ModuleTrackerTemplate.UnloadModule(null, null));
133132

134-
Assert.False(unloadTask.Wait(5));
133+
Assert.False(unloadTask.Wait(5));
135134

136-
WriteHitsFile(new[] { 0, 3, 2, 1 });
135+
WriteHitsFile(new[] { 0, 3, 2, 1 });
137136

138-
Assert.False(unloadTask.Wait(5));
137+
Assert.False(unloadTask.Wait(5));
139138

140-
mutex.ReleaseMutex();
141-
await unloadTask;
139+
mutex.ReleaseMutex();
140+
await unloadTask;
142141

143-
int[] expectedHitsArray = new[] { 0, 4, 4, 4 };
144-
Assert.Equal(expectedHitsArray, ReadHitsFile());
145-
}
142+
int[] expectedHitsArray = new[] { 0, 4, 4, 4 };
143+
Assert.Equal(expectedHitsArray, ReadHitsFile());
146144

147145
return 0;
148146
});

test/coverlet.integration.tests/WpfResolverTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ namespace coverlet.integration.tests
1717
public class WpfResolverTests : BaseTest
1818
{
1919
[ConditionalFact]
20-
[SkipOnOS(OS.Linux, "Windows path format only")]
21-
[SkipOnOS(OS.MacOS, "Windows path format only")]
20+
[SkipOnOS(OS.Linux, "WPF only runs on Windows")]
21+
[SkipOnOS(OS.MacOS, "WPF only runs on Windows")]
2222
public void TestInstrument_NetCoreSharedFrameworkResolver()
2323
{
2424
string wpfProjectPath = "../../../../coverlet.tests.projectsample.wpf";

test/coverlet.tests.projectsample.wpf/App.xaml

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/coverlet.tests.projectsample.wpf/App.xaml.cs

Lines changed: 0 additions & 20 deletions
This file was deleted.

test/coverlet.tests.projectsample.wpf/AssemblyInfo.cs

Lines changed: 0 additions & 13 deletions
This file was deleted.

test/coverlet.tests.projectsample.wpf/MainWindow.xaml

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/coverlet.tests.projectsample.wpf/MainWindow.xaml.cs

Lines changed: 0 additions & 31 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright (c) Toni Solarin-Sodara
2+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
3+
4+
using System.Windows.Controls;
5+
6+
namespace coverlet.tests.projectsample.wpf
7+
{
8+
public class TestClass
9+
{
10+
public static void Main(){}
11+
12+
public UserControl Control { get; set; } = null!;
13+
}
14+
}

0 commit comments

Comments
 (0)