private void WriteJittedMethodSummary(StreamWriter logWriter)
{
- Dictionary<string, HashSet<string>>[] allMethodsPerModulePerCompiler = new Dictionary<string, HashSet<string>>[(int)CompilerIndex.Count];
+ var allMethodsPerModulePerCompiler = new Dictionary<string, HashSet<string>>[(int)CompilerIndex.Count];
foreach (CompilerRunner runner in _compilerRunners)
{
{
for (int exeIndex = 0; exeIndex < folder.Executions.Count; exeIndex++)
{
- Dictionary<string, HashSet<string>>[] appMethodsPerModulePerCompiler = new Dictionary<string, HashSet<string>>[(int)CompilerIndex.Count];
+ var appMethodsPerModulePerCompiler = new Dictionary<string, HashSet<string>>[(int)CompilerIndex.Count];
foreach (CompilerRunner runner in _compilerRunners)
{
appMethodsPerModulePerCompiler[(int)runner.Index] = new Dictionary<string, HashSet<string>>();
return false;
}
- Stopwatch stopwatch = new Stopwatch();
- stopwatch.Start();
+ Stopwatch stopwatch = Stopwatch.StartNew();
ResolveTestExclusions();
- List<ProcessInfo> compilationsToRun = new List<ProcessInfo>();
+ var compilationsToRun = new List<ProcessInfo>();
foreach (BuildFolder folder in FoldersToBuild)
{
ParallelRunner.Run(compilationsToRun, _options.DegreeOfParallelism, _options.MeasurePerf);
bool success = true;
- List<KeyValuePair<string, string>> failedCompilationsPerBuilder = new List<KeyValuePair<string, string>>();
+ var failedCompilationsPerBuilder = new List<KeyValuePair<string, string>>();
int successfulCompileCount = 0;
- List<ProcessInfo> r2rDumpExecutionsToRun = new List<ProcessInfo>();
+ var r2rDumpExecutionsToRun = new List<ProcessInfo>();
foreach (BuildFolder folder in FoldersToBuild)
{
return true;
}
- Stopwatch stopwatch = new Stopwatch();
- stopwatch.Start();
+ Stopwatch stopwatch = Stopwatch.StartNew();
string coreRoot = _options.CoreRootDirectory.FullName;
string[] frameworkFolderFiles = Directory.GetFiles(coreRoot);
outputPath.RecreateDirectory();
}
- List<ProcessInfo> compilationsToRun = new List<ProcessInfo>();
- List<KeyValuePair<string, ProcessInfo[]>> compilationsPerRunner = new List<KeyValuePair<string, ProcessInfo[]>>();
- List<string> excludedAssemblies = new List<string>();
+ var compilationsToRun = new List<ProcessInfo>();
+ var compilationsPerRunner = new List<KeyValuePair<string, ProcessInfo[]>>();
+ var excludedAssemblies = new List<string>();
if (_options.Composite)
{
- ProcessInfo[] processes = new ProcessInfo[(int)CompilerIndex.Count];
+ var processes = new ProcessInfo[(int)CompilerIndex.Count];
foreach (CompilerRunner runner in frameworkRunners)
{
List<string> inputFrameworkDlls = new List<string>();
_frameworkExclusions[exclusion.SimpleName] = exclusion.Reason;
continue;
}
- ProcessInfo compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, _options.CoreRootDirectory.FullName, new string[] { frameworkDll }));
+ var compilationProcess = new ProcessInfo(new CompilationProcessConstructor(runner, _options.CoreRootDirectory.FullName, new string[] { frameworkDll }));
compilationsToRun.Add(compilationProcess);
processes[(int)runner.Index] = compilationProcess;
}
ParallelRunner.Run(compilationsToRun, _options.DegreeOfParallelism);
- HashSet<string>[] skipCopying = new HashSet<string>[(int)CompilerIndex.Count];
+ var skipCopying = new HashSet<string>[(int)CompilerIndex.Count];
foreach (CompilerRunner runner in frameworkRunners)
{
skipCopying[(int)runner.Index] = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
}
- int[] failedCompilationsPerBuilder = new int[(int)CompilerIndex.Count];
+ var failedCompilationsPerBuilder = new int[(int)CompilerIndex.Count];
int successfulCompileCount = 0;
int failedCompileCount = 0;
foreach (KeyValuePair<string, ProcessInfo[]> kvp in compilationsPerRunner)
public bool Execute()
{
- Stopwatch stopwatch = new Stopwatch();
- stopwatch.Start();
- List<ProcessInfo> executionsToRun = new List<ProcessInfo>();
+ Stopwatch stopwatch = Stopwatch.StartNew();
+ var executionsToRun = new List<ProcessInfo>();
foreach (BuildFolder folder in FoldersToBuild)
{
public bool Build()
{
- Stopwatch stopwatch = new Stopwatch();
- stopwatch.Start();
+ Stopwatch stopwatch = Stopwatch.StartNew();
bool success = _options.Exe || Compile();
private void WriteBuildStatistics(StreamWriter logWriter)
{
// The Count'th element corresponds to totals over all compiler runners used in the run
- int[,] compilationOutcomes = new int[(int)CompilationOutcome.Count, (int)CompilerIndex.Count + 1];
- int[,] executionOutcomes = new int[(int)ExecutionOutcome.Count, (int)CompilerIndex.Count + 1];
+ var compilationOutcomes = new int[(int)CompilationOutcome.Count, (int)CompilerIndex.Count + 1];
+ var executionOutcomes = new int[(int)ExecutionOutcome.Count, (int)CompilerIndex.Count + 1];
int totalCompilations = 0;
int totalExecutions = 0;
foreach (BuildFolder folder in FoldersToBuild)
{
- bool[] compilationFailedPerRunner = new bool[(int)CompilerIndex.Count];
+ var compilationFailedPerRunner = new bool[(int)CompilerIndex.Count];
if (!_options.Exe)
{
foreach (ProcessInfo[] compilation in folder.Compilations)
if (foldersToBuild != 0)
{
int lineSize = 10 * _compilerRunners.Count() + 13 + 8;
- string separator = new string('-', lineSize);
+ var separator = new string('-', lineSize);
if (!_options.Exe)
{
int keyLength = _frameworkExclusions.Keys.Max(key => key.Length);
const string SimpleNameTitle = "SIMPLE_NAME";
keyLength = Math.Max(keyLength, SimpleNameTitle.Length);
- StringBuilder title = new StringBuilder();
+ var title = new StringBuilder();
title.Append(SimpleNameTitle);
title.Append(' ', keyLength - SimpleNameTitle.Length);
title.Append(" | REASON");
logWriter.WriteLine(new string('-', title.Length));
foreach (KeyValuePair<string, string> exclusion in _frameworkExclusions.OrderBy(kvp => kvp.Key, StringComparer.OrdinalIgnoreCase))
{
- StringBuilder line = new StringBuilder();
+ var line = new StringBuilder();
line.Append(exclusion.Key);
line.Append(' ', keyLength - exclusion.Key.Length);
line.Append(" | ");
{
string baseFolder = _options.InputDirectory.FullName;
int baseOffset = baseFolder.Length + (baseFolder.Length > 0 && baseFolder[baseFolder.Length - 1] == Path.DirectorySeparatorChar ? 0 : 1);
- HashSet<string> folders = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
+ var folders = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (BuildFolder folder in FoldersToBuild)
{
string relativeFolder = "";
return;
}
- List<string> folderList = new List<string>(folders);
+ var folderList = new List<string>(folders);
folderList.Sort(StringComparer.OrdinalIgnoreCase);
logWriter.WriteLine();
logWriter.WriteLine("Folder statistics:");
private void WriteExecutableSizeStatistics(StreamWriter logWriter)
{
- List<ExeSizeInfo> sizeStats = new List<ExeSizeInfo>();
- HashSet<string> libraryHashes = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
+ var sizeStats = new List<ExeSizeInfo>();
+ var libraryHashes = new HashSet<string>(StringComparer.OrdinalIgnoreCase);
foreach (BuildFolder folder in FoldersToBuild)
{
public void WriteBuildLog(string buildLogPath)
{
- using (StreamWriter buildLogWriter = new StreamWriter(buildLogPath))
+ using (var buildLogWriter = new StreamWriter(buildLogPath))
{
WriteBuildStatistics(buildLogWriter);
}
public void WriteCombinedLog(string outputFile)
{
- using (StreamWriter combinedLog = new StreamWriter(outputFile))
+ using (var combinedLog = new StreamWriter(outputFile))
{
- StreamWriter[] perRunnerLog = new StreamWriter[(int)CompilerIndex.Count];
+ var perRunnerLog = new StreamWriter[(int)CompilerIndex.Count];
foreach (CompilerRunner runner in _compilerRunners)
{
string runnerLogPath = Path.ChangeExtension(outputFile, "-" + runner.CompilerName + ".log");
foreach (BuildFolder folder in FoldersToBuild)
{
- bool[] compilationErrorPerRunner = new bool[(int)CompilerIndex.Count];
+ var compilationErrorPerRunner = new bool[(int)CompilerIndex.Count];
if (!_options.Exe)
{
foreach (ProcessInfo[] compilation in folder.Compilations)
if (_options.Framework)
{
string frameworkExclusionsFile = Path.Combine(_options.OutputDirectory.FullName, "framework-exclusions-" + suffix);
- using (StreamWriter writer = new StreamWriter(frameworkExclusionsFile))
+ using (var writer = new StreamWriter(frameworkExclusionsFile))
{
WriteFrameworkExclusions(writer);
}
return;
}
- using (StreamWriter logWriter = new StreamWriter(fileName))
+ using (var logWriter = new StreamWriter(fileName))
{
foreach (KeyValuePair<string, byte> kvp in markerResults.OrderBy((kvp) => kvp.Key))
{
return;
}
- using (StreamWriter logWriter = new StreamWriter(fileName))
+ using (var logWriter = new StreamWriter(fileName))
{
int cpaotCount = cpaot.Count();
logWriter.WriteLine("Objects queried by CPAOT: {0}", cpaotCount);
private void WriteFileListPerCompilationOutcome(string outputFileName, CompilationOutcome outcome)
{
- List<string> filteredTestList = new List<string>();
+ var filteredTestList = new List<string>();
foreach (BuildFolder folder in _buildFolders)
{
foreach (ProcessInfo[] compilation in folder.Compilations)
private void WriteFileListPerExecutionOutcome(string outputFileName, ExecutionOutcome outcome)
{
- List<string> filteredTestList = new List<string>();
+ var filteredTestList = new List<string>();
foreach (BuildFolder folder in _buildFolders)
{
foreach (ProcessInfo[] execution in folder.Executions)