Skip to content

Commit

Permalink
Special handling for InvalidOperationException during discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
bradwilson committed Sep 6, 2015
1 parent 6527edf commit 8d5801b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions xunit.runner.visualstudio.testadapter/VsTestRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ static ITestCase Deserialize(LoggerHelper logger, ITestFrameworkExecutor executo

using (var visitor = visitorFactory(assemblyFileName, framework, discoveryOptions))
{
reporterMessageHandler.OnMessage(new TestAssemblyDiscoveryStarting(assembly, AppDomain != AppDomainSupport.Denied, shadowCopy, discoveryOptions));
reporterMessageHandler.OnMessage(new TestAssemblyDiscoveryStarting(assembly, framework.CanUseAppDomains && AppDomain != AppDomainSupport.Denied, shadowCopy, discoveryOptions));

framework.Find(includeSourceInformation: true, messageSink: visitor, discoveryOptions: discoveryOptions);
var totalTests = visitor.Finish();
Expand All @@ -207,7 +207,9 @@ static ITestCase Deserialize(LoggerHelper logger, ITestFrameworkExecutor executo
#if !PLATFORM_DOTNET
var fileLoad = ex as FileLoadException;
#endif
if (fileNotFound != null)
if (ex is InvalidOperationException)
logger.LogWarning("Skipping: {0} ({1})", fileName, ex.Message);
else if (fileNotFound != null)
logger.LogWarning("Skipping: {0} (could not find dependent assembly '{1}')", fileName, Path.GetFileNameWithoutExtension(fileNotFound.FileName));
#if !PLATFORM_DOTNET
else if (fileLoad != null)
Expand Down

0 comments on commit 8d5801b

Please sign in to comment.