提交 006b915c 编写于 作者: B Balaji Soundrarajan

Merge pull request #11086 from basoundr/FixNRE

Fix NRE and provide better verbosity
@echo off
@echo off
:: Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
call "%VS140COMNTOOLS%VsDevCmd.bat"
......@@ -9,6 +9,6 @@ pushd %~dp0
csi fetch_build.csx Master %~dp0..\..\..\..\Binaries\Release
:: Start Test Automation from the binaries directory
csi %~dp0..\..\..\..\Binaries\Release\Perf\infra\automation.csx
csi %~dp0..\..\..\..\Binaries\Release\Perf\infra\automation.csx --verbose
popd
\ No newline at end of file
......@@ -6,6 +6,7 @@
#load "./util/runner_util.csx"
// Log()
// StdoutFrom()
// IsVerbose()
#load "./util/tools_util.csx"
using System.Collections.Generic;
......@@ -33,7 +34,7 @@ foreach (var script in GetAllCsxRecursive(testDirectory))
testInstances.AddRange(tests);
}
var traceManager = TraceManagerFactory.GetTraceManager();
var traceManager = TraceManagerFactory.GetTraceManager(IsVerbose());
traceManager.Initialize();
foreach (var test in testInstances)
......
......@@ -19,13 +19,13 @@ public ConsoleAndFileLogger(string file = "log.txt")
public void Flush()
{
File.WriteAllText(_file, _buffer.ToString());
File.AppendAllText(_file, _buffer.ToString());
}
public void Log(string v)
{
Console.WriteLine(v);
_buffer.AppendLine(v);
Console.WriteLine(DateTime.Now + " : " + v);
_buffer.AppendLine(DateTime.Now + " : " + v);
}
}
}
......@@ -4,13 +4,17 @@ namespace Roslyn.Test.Performance.Utilities
{
public class TraceManagerFactory
{
public static ITraceManager GetTraceManager()
public static ITraceManager GetTraceManager(bool isVerbose = false)
{
var cpcFullPath = Path.Combine(TestUtilities.GetCPCDirectoryPath(), "CPC.exe");
var scenarioPath = TestUtilities.GetCPCDirectoryPath();
if (File.Exists(cpcFullPath))
{
return new TraceManager(cpcFullPath, scenarioPath, verbose: true, logger: null);
return new TraceManager(
cpcFullPath,
scenarioPath,
verbose: isVerbose,
logger: isVerbose ? new ConsoleAndFileLogger() : null);
}
else
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册