Skip to content

Commit

Permalink
[tests] Fix BuildBindingsTest expectations. (#20768)
Browse files Browse the repository at this point in the history
Fix BuildBindingsTest expectations to expect the resources in either a sidecar or a zipped sidecar.

Fixes this test failure:

    Xamarin.Tests.DotNetProjectTest.BuildBindingsTest(TVOS): Bundle existence
    Expected: file or directory exists
    But was: "/Users/builder/azdo/_work/1/s/xamarin-macios/tests/bindings-test/dotnet/tvOS/bin/Debug/net8.0-tvos/bindings-test.resources.zip"
  • Loading branch information
rolfbjarne authored Jun 27, 2024
1 parent 9b7ff19 commit 5f7792a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/dotnet/UnitTests/ProjectTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,10 @@ public void BuildBindingsTest (ApplePlatform platform)
// Verify that there's one resource in the binding assembly, and its name
var ad = AssemblyDefinition.ReadAssembly (asm, new ReaderParameters { ReadingMode = ReadingMode.Deferred });
Assert.That (ad.MainModule.Resources.Count, Is.EqualTo (0), "no embedded resources");
var resourceBundle = Path.Combine (project_dir, "bin", "Debug", platform.ToFramework (), assemblyName + ".resources.zip");
Assert.That (resourceBundle, Does.Exist, "Bundle existence");
var resourceBundle = Path.Combine (project_dir, "bin", "Debug", platform.ToFramework (), assemblyName + ".resources");
var resourceZip = resourceBundle + ".zip";
if (!Directory.Exists (resourceBundle) && !File.Exists (resourceZip))
Assert.Fail ($"Neither the sidecar {resourceBundle} or the zipped sidecar {resourceZip} exists.");
}

[TestCase (ApplePlatform.iOS)]
Expand Down

8 comments on commit 5f7792a

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.