Skip to content

Commit

Permalink
Fix test to not execute on platforms it can't execute on.
Browse files Browse the repository at this point in the history
  • Loading branch information
rolfbjarne authored and vs-mobiletools-engineering-service2 committed Nov 27, 2023
1 parent bc44576 commit d3f0797
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/dotnet/UnitTests/ProjectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1399,20 +1399,23 @@ public void BuildAndExecuteAppWithNativeDynamicLibrariesInPackageReference (Appl

[Test]
[TestCase (ApplePlatform.MacCatalyst, "maccatalyst-arm64")]
public void BuildAndExecuteAppWithXCFrameworkWithStaticLibraryInRuntimesNativeDirectory (ApplePlatform platform, string runtimeIdentifier)
public void BuildAndExecuteAppWithXCFrameworkWithStaticLibraryInRuntimesNativeDirectory (ApplePlatform platform, string runtimeIdentifiers)
{
var project = "AppWithXCFrameworkWithStaticLibraryInPackageReference";
Configuration.IgnoreIfIgnoredPlatform (platform);

var project_path = GetProjectPath (project, runtimeIdentifiers: runtimeIdentifier, platform: platform, out var appPath);
var project_path = GetProjectPath (project, runtimeIdentifiers: runtimeIdentifiers, platform: platform, out var appPath);
Clean (project_path);
var properties = GetDefaultProperties (runtimeIdentifier);
var properties = GetDefaultProperties (runtimeIdentifiers);
DotNet.AssertBuild (project_path, properties);

var appExecutable = Path.Combine (appPath, "Contents", "MacOS", Path.GetFileNameWithoutExtension (project_path));
Assert.That (appExecutable, Does.Exist, "There is an executable");

ExecuteWithMagicWordAndAssert (appExecutable);
if (CanExecute (platform, runtimeIdentifiers)) {
var output = ExecuteWithMagicWordAndAssert (appExecutable);
Assert.That (output, Does.Contain ("42"), "Execution");
}
}

[Test]
Expand Down

0 comments on commit d3f0797

Please sign in to comment.