Skip to content

Commit 6f8c354

Browse files
ilonatommylambdageek
authored andcommitted
[wasm] Dispose Xunit ToolCommand - follow up (dotnet#108387)
1 parent f312343 commit 6f8c354

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/mono/wasm/Wasm.Build.Tests/Common/TestOutputWrapper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public void WriteLine(string message)
1818
baseOutput.WriteLine(message);
1919
_outputBuffer.AppendLine(message);
2020
if (EnvironmentVariables.ShowBuildOutput)
21-
Console.WriteLine(message);
21+
Console.WriteLine(message);
2222
}
2323

2424
public void WriteLine(string format, params object[] args)

src/mono/wasm/Wasm.Build.Tests/NonWasmTemplateBuildTests.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,18 @@ private void NonWasmConsoleBuild(string config,
108108
File.WriteAllText(Path.Combine(_projectDir, "Directory.Build.props"), "<Project />");
109109
File.WriteAllText(Path.Combine(_projectDir, "Directory.Build.targets"), directoryBuildTargets);
110110

111-
using DotNetCommand cmd = new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false);
112-
cmd.WithWorkingDirectory(_projectDir!)
113-
.ExecuteWithCapturedOutput("new console --no-restore")
111+
using ToolCommand cmd = new DotNetCommand(s_buildEnv, _testOutput, useDefaultArgs: false)
112+
.WithWorkingDirectory(_projectDir!);
113+
cmd.ExecuteWithCapturedOutput("new console --no-restore")
114114
.EnsureSuccessful();
115115

116-
cmd.WithWorkingDirectory(_projectDir!)
117-
.ExecuteWithCapturedOutput($"build -restore -c {config} -bl:{Path.Combine(s_buildEnv.LogRootPath, $"{id}.binlog")} {extraBuildArgs} -f {targetFramework}")
116+
cmd.ExecuteWithCapturedOutput($"build -restore -c {config} -bl:{Path.Combine(s_buildEnv.LogRootPath, $"{id}.binlog")} {extraBuildArgs} -f {targetFramework}")
118117
.EnsureSuccessful();
119118

120119
if (shouldRun)
121120
{
122-
CommandResult result = cmd.WithWorkingDirectory(_projectDir!)
123-
.ExecuteWithCapturedOutput($"run -c {config} -f {targetFramework} --no-build")
124-
.EnsureSuccessful();
121+
CommandResult result = cmd.ExecuteWithCapturedOutput($"run -c {config} -f {targetFramework} --no-build")
122+
.EnsureSuccessful();
125123

126124
Assert.Contains("Hello, World!", result.Output);
127125
}

0 commit comments

Comments
 (0)