forked from dotnet/diagnostics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve SymbolService.ParseSymbolPath support for Watson. Issue dotne…
- Loading branch information
Showing
2 changed files
with
125 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
src/tests/Microsoft.Diagnostics.DebugServices.UnitTests/SymbolServiceTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// See the LICENSE file in the project root for more information. | ||
|
||
using Microsoft.Diagnostics.DebugServices.Implementation; | ||
using System; | ||
using System.Collections.Generic; | ||
using Xunit; | ||
|
||
namespace Microsoft.Diagnostics.DebugServices.UnitTests | ||
{ | ||
/// <summary> | ||
/// Test the service event implementation | ||
/// </summary> | ||
public class SymbolServiceTests : IHost | ||
{ | ||
public SymbolServiceTests() | ||
{ | ||
} | ||
|
||
[Fact] | ||
public void SymbolPathTests() | ||
{ | ||
var symbolService = new SymbolService(this); | ||
string defaultPath = $"Cache: {symbolService.DefaultSymbolCache}\r\nServer: http://msdl.microsoft.com/download/symbols/\r\n"; | ||
Assert.True(symbolService.ParseSymbolPath("srv*")); | ||
Assert.Equal(defaultPath, symbolService.ToString()); | ||
symbolService.DisableSymbolStore(); | ||
|
||
Assert.True(symbolService.ParseSymbolPath("srv**")); | ||
Assert.Equal(defaultPath, symbolService.ToString()); | ||
symbolService.DisableSymbolStore(); | ||
|
||
Assert.True(symbolService.ParseSymbolPath("cache*;srv*")); | ||
Assert.Equal(defaultPath, symbolService.ToString()); | ||
symbolService.DisableSymbolStore(); | ||
|
||
Assert.True(symbolService.ParseSymbolPath("srv*c:\\localsymbolcache*http://msdl.microsoft.com/download/symbols/")); | ||
Assert.Equal($"Cache: c:\\localsymbolcache\r\nServer: http://msdl.microsoft.com/download/symbols/\r\n", symbolService.ToString()); | ||
symbolService.DisableSymbolStore(); | ||
|
||
Assert.True(symbolService.ParseSymbolPath("srv**c:\\localsymbolcache*http://msdl.microsoft.com/download/symbols/")); | ||
Assert.Equal($"Cache: {symbolService.DefaultSymbolCache}\r\nCache: c:\\localsymbolcache\r\nServer: http://msdl.microsoft.com/download/symbols/\r\n", symbolService.ToString()); | ||
symbolService.DisableSymbolStore(); | ||
} | ||
|
||
#region IHost | ||
|
||
public IServiceEvent OnShutdownEvent { get; } = new ServiceEvent(); | ||
|
||
HostType IHost.HostType => HostType.DotnetDump; | ||
|
||
IServiceProvider IHost.Services => throw new NotImplementedException(); | ||
|
||
IEnumerable<ITarget> IHost.EnumerateTargets() => throw new NotImplementedException(); | ||
|
||
void IHost.DestroyTarget(ITarget target) => throw new NotImplementedException(); | ||
|
||
#endregion | ||
} | ||
} |