From 93416820718de7904617ab13494e8a57fbe2ca57 Mon Sep 17 00:00:00 2001 From: Andrii Tretiak Date: Mon, 17 Jun 2024 12:12:52 -0700 Subject: [PATCH] Disable PathMap for debug to fix symbols mapping (#670) * Disable PathMap for debug to fix symbols mapping Enabling it for debug prevent debugger from loading symbols * Update Directory.Build.props * Fix tests --------- Co-authored-by: Keith Cully <2370032+K-Cully@users.noreply.github.com> Co-authored-by: artempushkin <32305353+artempushkin@users.noreply.github.com> Co-authored-by: Neil <49037171+neilr81@users.noreply.github.com> --- Directory.Build.props | 7 +++++-- tests/Abstractions.UnitTests/TagTests.cs | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 703db742..ce00ccbc 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -74,7 +74,10 @@ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb $(MSBuildThisFileDirectory) - - $(MSBuildThisFileDirectory)=/ + + $(MSBuildThisFileDirectory)=/ diff --git a/tests/Abstractions.UnitTests/TagTests.cs b/tests/Abstractions.UnitTests/TagTests.cs index ff3d6af0..39d734b9 100644 --- a/tests/Abstractions.UnitTests/TagTests.cs +++ b/tests/Abstractions.UnitTests/TagTests.cs @@ -1,4 +1,4 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. +// Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT license. using Microsoft.Extensions.Logging; @@ -22,8 +22,17 @@ namespace Microsoft.Omex.Extensions.Abstractions.UnitTests string relativePath = "/tests/Abstractions.UnitTests/" + nameof(TagTests) + ".cs"; //This value should be change in case of changing file path or name - Assert.AreEqual(tag1.Name, relativePath, "tag1 Name should point to current file"); - Assert.AreEqual(tag2.Name, relativePath, "tag2 Name should point to current file"); + AssertTagNames(relativePath, tag1.Name, "tag1 Name should point to current file"); + AssertTagNames(relativePath, tag2.Name, "tag2 Name should point to current file"); + } + + private static void AssertTagNames(string expectedTag, string? actualTag, string message) + { +#if DEBUG + StringAssert.EndsWith(actualTag?.Replace('\\','/'), expectedTag, message); +#else + Assert.AreEqual(expectedTag, actualTag, message); +#endif } [DataTestMethod]