diff --git a/ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs b/ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs index d871bed94..967f564e6 100644 --- a/ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs +++ b/ICSharpCode.Decompiler.Tests/Helpers/Tester.VB.cs @@ -72,7 +72,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers { references = references.Concat(new[] { "-r:\"Microsoft.VisualBasic.dll\"" }); } - string otherOptions = $"-noconfig " + + string otherOptions = $"-nologo -noconfig " + "-optioninfer+ -optionexplicit+ " + $"-langversion:{languageVersion} " + $"/optimize{(flags.HasFlag(CompilerOptions.Optimize) ? "+ " : "- ")}"; @@ -122,8 +122,14 @@ namespace ICSharpCode.Decompiler.Tests.Helpers var result = await command.ExecuteBufferedAsync().ConfigureAwait(false); - Console.WriteLine("output: " + result.StandardOutput); - Console.WriteLine("errors: " + result.StandardError); + if (!string.IsNullOrWhiteSpace(result.StandardOutput)) + { + Console.WriteLine("output:" + Environment.NewLine + result.StandardOutput); + } + if (!string.IsNullOrWhiteSpace(result.StandardError)) + { + Console.WriteLine("errors:" + Environment.NewLine + result.StandardError); + } Assert.AreEqual(0, result.ExitCode, "vbc failed"); return results; diff --git a/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs b/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs index 3b880ca57..5c5fde420 100644 --- a/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs +++ b/ICSharpCode.Decompiler.Tests/Helpers/Tester.cs @@ -176,13 +176,19 @@ namespace ICSharpCode.Decompiler.Tests.Helpers } var command = Cli.Wrap(ilasmPath) - .WithArguments($"/nologo {otherOptions}/output=\"{outputFile}\" \"{sourceFileName}\"") + .WithArguments($"/quiet {otherOptions}/output=\"{outputFile}\" \"{sourceFileName}\"") .WithValidation(CommandResultValidation.None); var result = await command.ExecuteBufferedAsync().ConfigureAwait(false); - Console.WriteLine("output: " + result.StandardOutput); - Console.WriteLine("errors: " + result.StandardError); + if (!string.IsNullOrWhiteSpace(result.StandardOutput)) + { + Console.WriteLine("output:" + Environment.NewLine + result.StandardOutput); + } + if (!string.IsNullOrWhiteSpace(result.StandardError)) + { + Console.WriteLine("errors:" + Environment.NewLine + result.StandardError); + } Assert.AreEqual(0, result.ExitCode, "ilasm failed"); return outputFile; @@ -224,8 +230,14 @@ namespace ICSharpCode.Decompiler.Tests.Helpers var result = await command.ExecuteBufferedAsync().ConfigureAwait(false); - Console.WriteLine("output: " + result.StandardOutput); - Console.WriteLine("errors: " + result.StandardError); + if (!string.IsNullOrWhiteSpace(result.StandardOutput)) + { + Console.WriteLine("output:" + Environment.NewLine + result.StandardOutput); + } + if (!string.IsNullOrWhiteSpace(result.StandardError)) + { + Console.WriteLine("errors:" + Environment.NewLine + result.StandardError); + } Assert.AreEqual(0, result.ExitCode, "ildasm failed"); // Unlike the .imagebase directive (which is a fixed value when compiling with /deterministic), @@ -430,7 +442,7 @@ namespace ICSharpCode.Decompiler.Tests.Helpers { references = references.Concat(new[] { "-r:\"System.Runtime.CompilerServices.Unsafe.dll\"" }); } - string otherOptions = $"-noconfig " + + string otherOptions = $"-nologo -noconfig " + $"-langversion:{languageVersion} " + $"-unsafe -o{(flags.HasFlag(CompilerOptions.Optimize) ? "+ " : "- ")}"; @@ -485,9 +497,15 @@ namespace ICSharpCode.Decompiler.Tests.Helpers Console.WriteLine($"\"{command.TargetFilePath}\" {command.Arguments}"); var result = await command.ExecuteBufferedAsync().ConfigureAwait(false); + if (!string.IsNullOrWhiteSpace(result.StandardOutput)) + { + Console.WriteLine("output:" + Environment.NewLine + result.StandardOutput); + } + if (!string.IsNullOrWhiteSpace(result.StandardError)) + { + Console.WriteLine("errors:" + Environment.NewLine + result.StandardError); + } - Console.WriteLine("output: " + result.StandardOutput); - Console.WriteLine("errors: " + result.StandardError); Assert.AreEqual(0, result.ExitCode, "csc failed"); return results; @@ -542,8 +560,14 @@ namespace ICSharpCode.Decompiler.Tests.Helpers var result = await command.ExecuteBufferedAsync().ConfigureAwait(false); - Console.WriteLine("output: " + result.StandardOutput); - Console.WriteLine("errors: " + result.StandardError); + if (!string.IsNullOrWhiteSpace(result.StandardOutput)) + { + Console.WriteLine("output:" + Environment.NewLine + result.StandardOutput); + } + if (!string.IsNullOrWhiteSpace(result.StandardError)) + { + Console.WriteLine("errors:" + Environment.NewLine + result.StandardError); + } Assert.AreEqual(0, result.ExitCode, "mcs failed"); return results; @@ -815,8 +839,14 @@ namespace ICSharpCode.Decompiler.Tests.Helpers var result = await command.ExecuteBufferedAsync().ConfigureAwait(false); Assert.AreEqual(0, result.ExitCode, "sn failed"); - Console.WriteLine("output: " + result.StandardOutput); - Console.WriteLine("errors: " + result.StandardError); + if (!string.IsNullOrWhiteSpace(result.StandardOutput)) + { + Console.WriteLine("output:" + Environment.NewLine + result.StandardOutput); + } + if (!string.IsNullOrWhiteSpace(result.StandardError)) + { + Console.WriteLine("errors:" + Environment.NewLine + result.StandardError); + } } public static async Task FindMSBuild()