Update the publish tests to handle both self contained and not
Update the publish tests to target current and net6 Fix the selfcontained logic in the common test method
This commit is contained in:
parent
646195bd11
commit
1d3413654c
1 changed files with 27 additions and 15 deletions
|
@ -86,9 +86,11 @@ namespace EndToEnd.Tests
|
|||
}
|
||||
|
||||
[WindowsOnlyTheory]
|
||||
[InlineData("net5.0")]
|
||||
[InlineData("current")]
|
||||
public void ItCanPublishArm64Winforms(string TargetFramework)
|
||||
[InlineData("net6.0", true)]
|
||||
[InlineData("net6.0", false)]
|
||||
[InlineData("current", true)]
|
||||
[InlineData("current", false)]
|
||||
public void ItCanPublishArm64Winforms(string TargetFramework, bool selfContained)
|
||||
{
|
||||
DirectoryInfo directory = TestAssets.CreateTestDirectory();
|
||||
string projectDirectory = directory.FullName;
|
||||
|
@ -104,7 +106,8 @@ namespace EndToEnd.Tests
|
|||
.Execute(newArgs)
|
||||
.Should().Pass();
|
||||
|
||||
string publishArgs = "-r win-arm64";
|
||||
string selfContainedArgs = selfContained ? " --self-contained" : "";
|
||||
string publishArgs = "-r win-arm64" + selfContainedArgs;
|
||||
new PublishCommand()
|
||||
.WithWorkingDirectory(projectDirectory)
|
||||
.Execute(publishArgs)
|
||||
|
@ -114,14 +117,19 @@ namespace EndToEnd.Tests
|
|||
.Sub("bin").Sub(TargetFramework != "current" ? "Debug" : "Release").GetDirectories().FirstOrDefault()
|
||||
.Sub("win-arm64").Sub("publish");
|
||||
|
||||
selfContainedPublishDir.Should().HaveFilesMatching("System.Windows.Forms.dll", SearchOption.TopDirectoryOnly);
|
||||
if (selfContained)
|
||||
{
|
||||
selfContainedPublishDir.Should().HaveFilesMatching("System.Windows.Forms.dll", SearchOption.TopDirectoryOnly);
|
||||
}
|
||||
selfContainedPublishDir.Should().HaveFilesMatching($"{directory.Name}.dll", SearchOption.TopDirectoryOnly);
|
||||
}
|
||||
|
||||
[WindowsOnlyTheory]
|
||||
[InlineData("net5.0")]
|
||||
[InlineData("current")]
|
||||
public void ItCanPublishArm64Wpf(string TargetFramework)
|
||||
[InlineData("net6.0", true)]
|
||||
[InlineData("net6.0", false)]
|
||||
[InlineData("current", true)]
|
||||
[InlineData("current", false)]
|
||||
public void ItCanPublishArm64Wpf(string TargetFramework, bool selfContained)
|
||||
{
|
||||
DirectoryInfo directory = TestAssets.CreateTestDirectory();
|
||||
string projectDirectory = directory.FullName;
|
||||
|
@ -138,7 +146,8 @@ namespace EndToEnd.Tests
|
|||
.Execute(newArgs)
|
||||
.Should().Pass();
|
||||
|
||||
string publishArgs = "-r win-arm64";
|
||||
string selfContainedArgs = selfContained ? " --self-contained" : "";
|
||||
string publishArgs = "-r win-arm64" + selfContainedArgs;
|
||||
new PublishCommand()
|
||||
.WithWorkingDirectory(projectDirectory)
|
||||
.Execute(publishArgs)
|
||||
|
@ -148,8 +157,11 @@ namespace EndToEnd.Tests
|
|||
.Sub("bin").Sub(TargetFramework != "current" ? "Debug" : "Release").GetDirectories().FirstOrDefault()
|
||||
.Sub("win-arm64").Sub("publish");
|
||||
|
||||
selfContainedPublishDir.Should().HaveFilesMatching("PresentationCore.dll", SearchOption.TopDirectoryOnly);
|
||||
selfContainedPublishDir.Should().HaveFilesMatching("PresentationNative_*.dll", SearchOption.TopDirectoryOnly);
|
||||
if (selfContained)
|
||||
{
|
||||
selfContainedPublishDir.Should().HaveFilesMatching("PresentationCore.dll", SearchOption.TopDirectoryOnly);
|
||||
selfContainedPublishDir.Should().HaveFilesMatching("PresentationNative_*.dll", SearchOption.TopDirectoryOnly);
|
||||
}
|
||||
selfContainedPublishDir.Should().HaveFilesMatching($"{directory.Name}.dll", SearchOption.TopDirectoryOnly);
|
||||
}
|
||||
|
||||
|
@ -296,7 +308,7 @@ namespace EndToEnd.Tests
|
|||
[InlineData("wpf")]
|
||||
public void ItCanBuildDesktopTemplatesSelfContained(string templateName)
|
||||
{
|
||||
TestTemplateCreateAndBuild(templateName);
|
||||
TestTemplateCreateAndBuild(templateName, selfContained: true);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
@ -351,7 +363,7 @@ namespace EndToEnd.Tests
|
|||
public void ItCanCreateAndBuildTemplatesWithDefaultFramework(string templateName, string language = "")
|
||||
{
|
||||
string framework = DetectExpectedDefaultFramework(templateName);
|
||||
TestTemplateCreateAndBuild(templateName, selfContained: true, language: language, framework: framework);
|
||||
TestTemplateCreateAndBuild(templateName, selfContained: false, language: language, framework: framework);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -398,7 +410,7 @@ namespace EndToEnd.Tests
|
|||
public void ItCanCreateAndBuildTemplatesWithDefaultFramework_Windows(string templateName, string language = "")
|
||||
{
|
||||
string framework = DetectExpectedDefaultFramework(templateName);
|
||||
TestTemplateCreateAndBuild(templateName, selfContained: true, language: language, framework: $"{framework}-windows");
|
||||
TestTemplateCreateAndBuild(templateName, selfContained: false, language: language, framework: $"{framework}-windows");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -459,7 +471,7 @@ namespace EndToEnd.Tests
|
|||
|
||||
if (build)
|
||||
{
|
||||
string buildArgs = selfContained ? "" : $"-r {RuntimeInformation.RuntimeIdentifier}";
|
||||
string buildArgs = selfContained ? $"-r {RuntimeInformation.RuntimeIdentifier} --self-contained" : "";
|
||||
if (!string.IsNullOrWhiteSpace(framework))
|
||||
{
|
||||
buildArgs += $" --framework {framework}";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue