Skip to content

Commit

Permalink
add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattleibow committed Jun 25, 2024
1 parent a1eafa2 commit fad7c1c
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/TestUtils/src/Microsoft.Maui.IntegrationTests/TemplateTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,37 @@ public void BuildWindowsAppSDKSelfContained(string id, bool wasdkself, bool nets
$"Project {Path.GetFileName(projectFile)} failed to build. Check test output/attachments for errors.");
}

[Test]
[TestCase("maui", true, true)]
[TestCase("maui", true, false)]
[TestCase("maui", false, true)]
[TestCase("maui", false, false)]
public void BuildWindowsRidGraph(string id, bool useridgraph, bool unpackaged)
{
if (TestEnvironment.IsMacOS)
Assert.Ignore("This test is designed for testing a windows build.");

var projectDir = TestDirectory;
var projectFile = Path.Combine(projectDir, $"{Path.GetFileName(projectDir)}.csproj");

Assert.IsTrue(DotnetInternal.New(id, projectDir, DotNetCurrent),
$"Unable to create template {id}. Check test output for errors.");

FileUtilities.ReplaceInFile(projectFile,
"<UseMaui>true</UseMaui>",
$"""
<UseMaui>true</UseMaui>
<UseRidGraph>{useridgraph}</UseRidGraph>
<WindowsPackageType>{unpackaged}</WindowsPackageType>
""");

var extendedBuildProps = BuildProps;
extendedBuildProps.Add($"TargetFramework={DotNetCurrent}-windows10.0.19041.0");

Assert.IsTrue(DotnetInternal.Build(projectFile, "Release", properties: extendedBuildProps, msbuildWarningsAsErrors: true),
$"Project {Path.GetFileName(projectFile)} failed to build. Check test output/attachments for errors.");
}

[Test]
[TestCase("maui", $"{DotNetCurrent}-ios", "ios-arm64")]
public void PublishNativeAOT(string id, string framework, string runtimeIdentifier)
Expand Down

0 comments on commit fad7c1c

Please sign in to comment.