Adjust PgoManager format to better match a default pgosweep format
This commit is contained in:
parent
8c1baa8aeb
commit
1746acdea5
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
@ -9,16 +9,25 @@ namespace WindowsTerminal.UIA.Tests.Common
|
|||
{
|
||||
public static class PgoManager
|
||||
{
|
||||
private static string TrimExtension(string str)
|
||||
{
|
||||
if (str.EndsWith(".exe") || str.EndsWith(".dll"))
|
||||
{
|
||||
return str.Substring(0, str.Length - 4);
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
public static void PgoSweepIfInstrumented(TestContext context, string assemblyName)
|
||||
{
|
||||
#if PGO_INSTRUMENT
|
||||
#if true
|
||||
string pgcFileName = context.TestName;
|
||||
Log.Comment($"Running pgosweep on '{assemblyName}' for test: {pgcFileName}");
|
||||
try
|
||||
{
|
||||
var startInfo = new ProcessStartInfo() {
|
||||
FileName = Path.GetFullPath(Path.Combine(context.TestDeploymentDir, "pgosweep.exe")),
|
||||
Arguments = $"{assemblyName} {assemblyName}-{pgcFileName}.pgc",
|
||||
Arguments = $"{assemblyName} {TrimExtension(assemblyName)}!{pgcFileName}.pgc",
|
||||
UseShellExecute = false,
|
||||
RedirectStandardOutput = true
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue