mirror of
https://github.com/github/codeql.git
synced 2026-04-28 18:25:24 +02:00
C#: Address C# code comments.
This commit is contained in:
@@ -109,7 +109,7 @@ namespace Semmle.Extraction
|
||||
{
|
||||
// the attribute for the git information are always attached to the entry assembly by our build system
|
||||
var assembly = Assembly.GetEntryAssembly();
|
||||
var versionString = assembly!.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
|
||||
var versionString = assembly?.GetCustomAttribute<AssemblyInformationalVersionAttribute>();
|
||||
if (versionString == null)
|
||||
{
|
||||
return "unknown (not built from internal bazel workspace)";
|
||||
|
||||
@@ -63,23 +63,25 @@ public class Testrunner
|
||||
public int RunTests()
|
||||
{
|
||||
var assembly = Assembly.GetExecutingAssembly();
|
||||
var testrunner = AssemblyRunner.WithoutAppDomain(assembly.Location);
|
||||
testrunner.OnDiscoveryComplete = OnDiscoveryComplete;
|
||||
testrunner.OnExecutionComplete = OnExecutionComplete;
|
||||
testrunner.OnTestFailed = OnTestFailed;
|
||||
testrunner.OnTestSkipped = OnTestSkipped;
|
||||
using (var testrunner = AssemblyRunner.WithoutAppDomain(assembly.Location))
|
||||
{
|
||||
testrunner.OnDiscoveryComplete = OnDiscoveryComplete;
|
||||
testrunner.OnExecutionComplete = OnExecutionComplete;
|
||||
testrunner.OnTestFailed = OnTestFailed;
|
||||
testrunner.OnTestSkipped = OnTestSkipped;
|
||||
|
||||
Console.WriteLine("Discovering tests...");
|
||||
testrunner.Start(parallelAlgorithm: null);
|
||||
Console.WriteLine("Discovering tests...");
|
||||
testrunner.Start(parallelAlgorithm: null);
|
||||
|
||||
Finished.WaitOne();
|
||||
Finished.Dispose();
|
||||
Finished.WaitOne();
|
||||
Finished.Dispose();
|
||||
|
||||
// Wait for assembly runner to finish.
|
||||
// If we try to dispose while runner is executing,
|
||||
// it will throw an error.
|
||||
while (testrunner.Status != AssemblyRunnerStatus.Idle)
|
||||
Thread.Sleep(100);
|
||||
// Wait for assembly runner to finish.
|
||||
// If we try to dispose while runner is executing,
|
||||
// it will throw an error.
|
||||
while (testrunner.Status != AssemblyRunnerStatus.Idle)
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
return Result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user