From 5f7792ab91ebd1e327a339e9a9bd7a282d55dcf6 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 27 Jun 2024 09:38:12 +0200 Subject: [PATCH] [tests] Fix BuildBindingsTest expectations. (#20768) 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" --- tests/dotnet/UnitTests/ProjectTest.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/dotnet/UnitTests/ProjectTest.cs b/tests/dotnet/UnitTests/ProjectTest.cs index 917d7e136f6..ad973132a11 100644 --- a/tests/dotnet/UnitTests/ProjectTest.cs +++ b/tests/dotnet/UnitTests/ProjectTest.cs @@ -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)]