Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f943e83f8bb6
Choose a base ref
...
head repository: mockingbirdnest/Principia
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 75f44444146d
Choose a head ref
  • 2 commits
  • 1 file changed
  • 2 contributors

Commits on Dec 26, 2018

  1. Copy the full SHA
    9e1f437 View commit details
  2. Merge pull request #2036 from eggrobin/on-error-resume-next

    Ignore AccessViolationException in the coverage analyser
    pleroy authored Dec 26, 2018
    Copy the full SHA
    75f4444 View commit details
Showing with 18 additions and 7 deletions.
  1. +18 −7 coverage_analyser/coverage_analyser.cs
25 changes: 18 additions & 7 deletions coverage_analyser/coverage_analyser.cs
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.ExceptionServices;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@@ -17,6 +18,7 @@ private struct CodeLine {
public string file;
}

[HandleProcessCorruptedStateExceptions]
private static void Main(string[] args) {
Int64 lines_covered = 0;
Int64 lines_partially_covered = 0;
@@ -30,7 +32,7 @@ private static void Main(string[] args) {
var lines = new List<BlockLineRange>();
foreach (ICoverageModule module in info.Modules) {
Console.WriteLine("Analysing " + module.Name);

Regex module_regex = new Regex(@"^(.+?)(_tests?)+.exe");
Match module_match = module_regex.Match(module.Name);
string tested_unit = module_match.Groups[1].ToString();
@@ -56,12 +58,21 @@ private static void Main(string[] args) {
string undecoratedMethodName;
string className;
string namespaceName;
while (reader.GetNextMethod(out methodId,
out methodName,
out undecoratedMethodName,
out className,
out namespaceName,
lines)) {

for (;;) {
try {
if (!reader.GetNextMethod(out methodId,
out methodName,
out undecoratedMethodName,
out className,
out namespaceName,
lines)) {
break;
}
} catch (AccessViolationException e) {
Console.WriteLine(e.ToString());
continue;
}
if (regex.Match(methodName).Success) {
foreach (var line in lines) {
if (!ignored_files_regex.Match(line.SourceFile).Success) {