Skip to content

Commit dd6e894

Browse files
committed
Fix roslyn build task tests
1 parent a619b02 commit dd6e894

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

Directory.Packages.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<NoWarn>$(NoWarn);NU1507</NoWarn>
66
</PropertyGroup>
77
<ItemGroup>
8-
<PackageVersion Include="Basic.CompilerLog.Util" Version="0.9.9" />
8+
<PackageVersion Include="Basic.CompilerLog.Util" Version="0.9.18" />
99
<PackageVersion Include="AwesomeAssertions" Version="$(AwesomeAssertionsVersion)" />
1010
<PackageVersion Include="BenchmarkDotNet" Version="$(BenchmarkDotNetPackageVersion)" />
1111
<PackageVersion Include="AwesomeAssertions.Json" Version="$(AwesomeAssertionsJsonVersion)" />
@@ -93,7 +93,7 @@
9393
<PackageVersion Include="Microsoft.WixToolset.Heat" Version="$(MicrosoftWixToolsetSdkVersion)" />
9494
<PackageVersion Include="Microsoft.WixToolset.Util.wixext" Version="$(MicrosoftWixToolsetSdkVersion)" />
9595
<PackageVersion Include="Microsoft.WixToolset.UI.wixext" Version="$(MicrosoftWixToolsetSdkVersion)" />
96-
<PackageVersion Include="MSBuild.StructuredLogger" Version="2.2.386" />
96+
<PackageVersion Include="MSBuild.StructuredLogger" Version="2.3.45" />
9797
<PackageVersion Include="Moq" Version="$(MoqPackageVersion)" />
9898
<PackageVersion Include="NETStandard.Library.NETFramework" Version="$(NETStandardLibraryNETFrameworkVersion)" />
9999
<PackageVersion Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />

test/Microsoft.NET.Build.Tests/RoslynBuildTaskTests.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Basic.CompilerLog.Util;
77
using Microsoft.Build.Logging.StructuredLogger;
88
using Microsoft.CodeAnalysis;
9+
using Microsoft.DotNet.Cli.Utils;
910

1011
namespace Microsoft.NET.Build.Tests;
1112

@@ -18,16 +19,16 @@ public sealed class RoslynBuildTaskTests(ITestOutputHelper log) : SdkTest(log)
1819
_ => throw new ArgumentOutOfRangeException(paramName: nameof(language)),
1920
};
2021

21-
private static string CoreCompilerFileName(Language language) => CompilerFileNameWithoutExtension(language) + ".dll";
22+
private static string DotNetExecCompilerFileName(Language language) => CompilerFileNameWithoutExtension(language) + ".dll";
2223

23-
private static string FxCompilerFileName(Language language) => CompilerFileNameWithoutExtension(language) + ".exe";
24+
private static string AppHostCompilerFileName(Language language) => CompilerFileNameWithoutExtension(language) + FileNameSuffixes.CurrentPlatform.Exe;
2425

2526
[FullMSBuildOnlyTheory, CombinatorialData]
2627
public void FullMSBuild_SdkStyle(bool useSharedCompilation, Language language)
2728
{
2829
var testAsset = CreateProject(useSharedCompilation, language);
2930
var buildCommand = BuildAndRunUsingMSBuild(testAsset);
30-
VerifyCompiler(buildCommand, CoreCompilerFileName(language), useSharedCompilation);
31+
VerifyCompiler(buildCommand, AppHostCompilerFileName(language), useSharedCompilation);
3132
}
3233

3334
[FullMSBuildOnlyTheory, CombinatorialData]
@@ -38,7 +39,7 @@ public void FullMSBuild_SdkStyle_OptOut(bool useSharedCompilation, Language lang
3839
doc.Root!.Element("PropertyGroup")!.Add(new XElement("RoslynCompilerType", "Framework"));
3940
});
4041
var buildCommand = BuildAndRunUsingMSBuild(testAsset);
41-
VerifyCompiler(buildCommand, FxCompilerFileName(language), useSharedCompilation);
42+
VerifyCompiler(buildCommand, AppHostCompilerFileName(language), useSharedCompilation);
4243
}
4344

4445
[FullMSBuildOnlyTheory, CombinatorialData]
@@ -50,23 +51,23 @@ public void FullMSBuild_NonSdkStyle(bool useSharedCompilation, Language language
5051
project.TargetFrameworkVersion = "v4.7.2";
5152
});
5253
var buildCommand = BuildAndRunUsingMSBuild(testAsset);
53-
VerifyCompiler(buildCommand, FxCompilerFileName(language), useSharedCompilation);
54+
VerifyCompiler(buildCommand, AppHostCompilerFileName(language), useSharedCompilation);
5455
}
5556

5657
[FullMSBuildOnlyTheory, CombinatorialData]
5758
public void FullMSBuild_SdkStyle_ToolsetPackage(bool useSharedCompilation, Language language)
5859
{
5960
var testAsset = CreateProject(useSharedCompilation, language, AddCompilersToolsetPackage);
6061
var buildCommand = BuildAndRunUsingMSBuild(testAsset);
61-
VerifyCompiler(buildCommand, FxCompilerFileName(language), useSharedCompilation, toolsetPackage: true);
62+
VerifyCompiler(buildCommand, AppHostCompilerFileName(language), useSharedCompilation, toolsetPackage: true);
6263
}
6364

6465
[Theory, CombinatorialData]
6566
public void DotNet(bool useSharedCompilation, Language language)
6667
{
6768
var testAsset = CreateProject(useSharedCompilation, language);
6869
var buildCommand = BuildAndRunUsingDotNet(testAsset);
69-
VerifyCompiler(buildCommand, CoreCompilerFileName(language), useSharedCompilation);
70+
VerifyCompiler(buildCommand, AppHostCompilerFileName(language), useSharedCompilation);
7071
}
7172

7273
// https://github.com/dotnet/sdk/issues/49665
@@ -75,7 +76,7 @@ public void DotNet_ToolsetPackage(bool useSharedCompilation, Language language)
7576
{
7677
var testAsset = CreateProject(useSharedCompilation, language, AddCompilersToolsetPackage);
7778
var buildCommand = BuildAndRunUsingDotNet(testAsset);
78-
VerifyCompiler(buildCommand, CoreCompilerFileName(language), useSharedCompilation, toolsetPackage: true);
79+
VerifyCompiler(buildCommand, DotNetExecCompilerFileName(language), useSharedCompilation, toolsetPackage: true);
7980
}
8081

8182
private TestAsset CreateProject(bool useSharedCompilation, Language language, Action<TestProject>? configure = null, [CallerMemberName] string callingMethod = "")

0 commit comments

Comments
 (0)