From 67116e0a7399ae668ede7985aaeb1c0e785683bb Mon Sep 17 00:00:00 2001 From: Mike Voorhees Date: Mon, 14 Aug 2017 17:07:29 -0400 Subject: Extension point for setting up pedump process --- linker/Tests/TestCasesRunner/PeVerifier.cs | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'linker') diff --git a/linker/Tests/TestCasesRunner/PeVerifier.cs b/linker/Tests/TestCasesRunner/PeVerifier.cs index 0d87b63f5..7acda1d94 100644 --- a/linker/Tests/TestCasesRunner/PeVerifier.cs +++ b/linker/Tests/TestCasesRunner/PeVerifier.cs @@ -77,13 +77,8 @@ namespace Mono.Linker.Tests.TestCasesRunner { private void CheckAssembly (NPath assemblyPath) { var capturedOutput = new List (); - var exeArgs = Environment.OSVersion.Platform == PlatformID.Win32NT ? $"/nologo {assemblyPath.InQuotes ()}" : $"--verify metadata,code {assemblyPath.InQuotes ()}"; var process = new Process (); - process.StartInfo.FileName = _peExecutable; - process.StartInfo.Arguments = exeArgs; - process.StartInfo.UseShellExecute = false; - process.StartInfo.CreateNoWindow = true; - process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + SetupProcess (process, assemblyPath); process.StartInfo.RedirectStandardOutput = true; process.OutputDataReceived += (sender, args) => capturedOutput.Add (args.Data); process.Start (); @@ -95,6 +90,16 @@ namespace Mono.Linker.Tests.TestCasesRunner { } } + protected virtual void SetupProcess (Process process, NPath assemblyPath) + { + var exeArgs = Environment.OSVersion.Platform == PlatformID.Win32NT ? $"/nologo {assemblyPath.InQuotes ()}" : $"--verify metadata,code {assemblyPath.InQuotes ()}"; + process.StartInfo.FileName = _peExecutable; + process.StartInfo.Arguments = exeArgs; + process.StartInfo.UseShellExecute = false; + process.StartInfo.CreateNoWindow = true; + process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + } + public static NPath FindPeExecutableFromRegistry () { if (Environment.OSVersion.Platform != PlatformID.Win32NT) -- cgit v1.2.3