diff options
author | Mike Voorhees <michaelv@unity3d.com> | 2017-08-15 00:07:29 +0300 |
---|---|---|
committer | Marek Safar <marek.safar@gmail.com> | 2017-08-15 16:37:54 +0300 |
commit | 67116e0a7399ae668ede7985aaeb1c0e785683bb (patch) | |
tree | 7b375252bb3161a6d5397a2b34f8bc229b18d63b /linker | |
parent | a85abdbaed03a0780ca815283082d457ff19e7d4 (diff) |
Extension point for setting up pedump process
Diffstat (limited to 'linker')
-rw-r--r-- | linker/Tests/TestCasesRunner/PeVerifier.cs | 17 |
1 files changed, 11 insertions, 6 deletions
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<string> (); - 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) |