Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
daveMueller committed Mar 14, 2023
1 parent eed8edf commit 12d3a15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
8 changes: 4 additions & 4 deletions test/coverlet.core.tests/Coverage/CoverageTests.AsyncAwait.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ public void AsyncAwait_Issue_669_2()
return 0;
}, new string[] { path });

//TestInstrumentationHelper.GetCoverageResult(path)
//.Document("Instrumentation.AsyncAwait.cs")
//.AssertLinesCovered(BuildConfiguration.Debug, (7, 1), (10, 1), (11, 1), (12, 1), (13, 1), (15, 1))
//.ExpectedTotalNumberOfBranches(BuildConfiguration.Debug, 0);
TestInstrumentationHelper.GetCoverageResult(path)
.Document("Instrumentation.AsyncAwait.cs")
.AssertLinesCovered(BuildConfiguration.Debug, (7, 1), (10, 1), (11, 1), (12, 1), (13, 1), (15, 1))
.ExpectedTotalNumberOfBranches(BuildConfiguration.Debug, 0);
}
finally
{
Expand Down
7 changes: 1 addition & 6 deletions test/coverlet.core.tests/Coverage/InstrumenterHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,19 +133,14 @@ public static CoverageResult GetCoverageResult(string filePath)
s_processWideContainer.GetService<IInstrumentationHelper>(), s_processWideContainer.GetService<IFileSystem>(), s_processWideContainer.GetService<ISourceRootTranslator>(), s_processWideContainer.GetService<ICecilSymbolHelper>());
CoveragePrepareResult prepareResult = coverage.PrepareModules();

//Assert.Single(prepareResult.Results);
Assert.Single(prepareResult.Results);

// Load new assembly
var asm = Assembly.LoadFile(newPath);

// Instance type and call method
await callMethod(Activator.CreateInstance(asm.GetType(typeof(T).FullName)));

if (typeof(T).FullName.Contains("Issue_669_2"))
{
throw new Exception($"Location: {location}; AssemblyName: {asm.GetName().Name}; AssemblyLocation: {assemblyLocation}; AssemblyTypes: {string.Join(Environment.NewLine, asm.GetTypes().Select(x => x.FullName).ToList())}");
}

// Flush tracker
Type tracker = asm.GetTypes().Single(n => n.FullName.Contains("Coverlet.Core.Instrumentation.Tracker"));

Expand Down

0 comments on commit 12d3a15

Please sign in to comment.