Skip to content
This repository was archived by the owner on Nov 15, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions default.build
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@

</target>

<target name="sonarqube-build-release" depends="clean-all, build-environment, build-release-platforms" />

<target name="sonarqube-build-debug" depends="clean-all, build-environment, build-debug-platforms" />

<target name="quick-build-release" depends="clean, build-environment, build-release-platforms, test, test-cpp" />

<target name="set-rc-property" >
<property name="buildnumber.ci" value="-rc" />
</target>
Expand Down
18 changes: 10 additions & 8 deletions main/OpenCover.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,15 @@ static int Main(string[] args)
private static void CurrentDomainOnUnhandledException(object sender, UnhandledExceptionEventArgs unhandledExceptionEventArgs)
{
var ex = (Exception)unhandledExceptionEventArgs.ExceptionObject;
Logger.Fatal("At: CurrentDomainOnUnhandledException");
Logger.FatalFormat("An {0} occured: {1}", ex.GetType(), ex.Message);
Logger.FatalFormat("stack: {0}", ex.StackTrace);
Logger.FatalFormat("A report has been sent to the OpenCover development team...");
//if (!(ex is ExitApplicationWithoutReportingException))
{
Logger.Fatal("At: CurrentDomainOnUnhandledException");
Logger.FatalFormat("An {0} occured: {1}", ex.GetType(), ex.Message);
Logger.FatalFormat("stack: {0}", ex.StackTrace);
Logger.FatalFormat("A report has been sent to the OpenCover development team...");

ReportCrash((Exception)unhandledExceptionEventArgs.ExceptionObject);
ReportCrash((Exception)unhandledExceptionEventArgs.ExceptionObject);
}

Environment.Exit(0);
}
Expand All @@ -124,7 +127,7 @@ private static void ReportCrash(Exception exception)
}
};

uploader.SendAnonymousReport(SendRequestState.GetClientLib(), state.GetApplication(), state.GetExceptionDescription(true));
uploader.SendAnonymousReport(SendRequestState.GetClientLib(), state.GetApplication(), state.GetExceptionDescription(false));
}
}
catch (Exception)
Expand Down Expand Up @@ -375,10 +378,9 @@ private static int RunProcess(CommandLineParser parser, Action<StringDictionary>
}
catch (Exception ex)
{
ex.InformUser();
Logger.ErrorFormat("Failed to execute the following command '{0} {1}'", startInfo.FileName, startInfo.Arguments);
throw new ExitApplicationWithoutReportingException();
}
return 1;
}

private static void DisplayResults(CoverageSession coverageSession, ICommandLine parser, ILog logger)
Expand Down
9 changes: 5 additions & 4 deletions main/OpenCover.Framework/Manager/ProfilerManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,11 @@ private WaitCallback SetProfilerAttributes(Action<Action<StringDictionary>> proc
{
process(dictionary =>
{
if (dictionary == null) return;
SetProfilerAttributesOnDictionary(profilerKey, profilerNamespace, dictionary);

environmentKeyRead.Set();
if (dictionary != null)
{
SetProfilerAttributesOnDictionary(profilerKey, profilerNamespace, dictionary);
environmentKeyRead.Set();
}
});
}
finally
Expand Down
2 changes: 1 addition & 1 deletion main/OpenCover.Framework/Persistance/BasePersistance.cs
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ private static void TransformSequences_RemoveCompilerGeneratedBranches (IEnumera
var sourceLineOrderedSps = method.SequencePoints.OrderBy(sp => sp.StartLine).ThenBy(sp => sp.StartColumn).Where(sp => sp.FileId == method.FileRef.UniqueId).ToArray();

// find getter/setter/static-method "{" offset
if (sourceRepository.IsLeftCurlyBraceSequencePoint(sourceLineOrderedSps[0])) {
if (sourceLineOrderedSps.Length > 0 && sourceRepository.IsLeftCurlyBraceSequencePoint(sourceLineOrderedSps[0])) {
startOffset = sourceLineOrderedSps[0].Offset;
// find method "}" offset
if (sourceLineOrderedSps.Length > 1 && sourceRepository.IsRightCurlyBraceSequencePoint(sourceLineOrderedSps.Last())) {
Expand Down