Skip to content

Commit 57ff0dd

Browse files
committed
Revert to test projects created in bindir, instead of a temp one
This was necessary because on windows the tmp path is very long, causing the test project paths to become too long causing build failures.
1 parent 0aa1b5a commit 57ff0dd

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class BuildEnvironment
2727
public static readonly string RelativeTestAssetsPath = @"..\testassets\";
2828
public static readonly string TestAssetsPath = Path.Combine(AppContext.BaseDirectory, "testassets");
2929
public static readonly string TestDataPath = Path.Combine(AppContext.BaseDirectory, "data");
30-
public static readonly string TmpPath = Path.Combine(Path.GetTempPath(), "wasmbuildtests");
30+
public static readonly string TmpPath = Path.Combine(AppContext.BaseDirectory, "wbt");
3131

3232
private static readonly Dictionary<string, string> s_runtimePackVersions = new();
3333

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ protected static string RunWithXHarness(string testCommand, string testLogPath,
281281
protected void InitPaths(string id)
282282
{
283283
if (_projectDir == null)
284-
_projectDir = Path.Combine(AppContext.BaseDirectory, id);
284+
_projectDir = Path.Combine(BuildEnvironment.TmpPath, id);
285285
_logPath = Path.Combine(s_buildEnv.LogRootPath, id);
286286
_nugetPackagesDir = Path.Combine(BuildEnvironment.TmpPath, "nuget", id);
287287

@@ -466,7 +466,7 @@ private static string GetNuGetConfigWithLocalPackagesPath(string templatePath, s
466466
public string CreateWasmTemplateProject(string id, string template = "wasmbrowser", string extraArgs = "")
467467
{
468468
InitPaths(id);
469-
InitProjectDir(id, addNuGetSourceForLocalPackages: true);
469+
InitProjectDir(_projectDir, addNuGetSourceForLocalPackages: true);
470470

471471
File.WriteAllText(Path.Combine(_projectDir, "Directory.Build.props"), "<Project />");
472472
File.WriteAllText(Path.Combine(_projectDir, "Directory.Build.targets"),

0 commit comments

Comments
 (0)