public void DiscoverTests(IEnumerable <string> executables, IDiscoveryContext discoveryContext,
IMessageLogger logger, ITestCaseDiscoverySink discoverySink)
{
if (_testEnvironment == null || _testEnvironment.Options.GetType() == typeof(SettingsWrapper)) // check whether we have a mock
{
_testEnvironment = TestExecutor.CreateTestEnvironment(discoveryContext.RunSettings, logger);
_discoverer = new GoogleTestDiscoverer(_testEnvironment);
}
try
{
VsTestFrameworkReporter reporter = new VsTestFrameworkReporter(discoverySink);
_discoverer.DiscoverTests(executables, reporter);
}
catch (Exception e)
{
_testEnvironment.LogError("Exception while discovering tests: " + e);
}
}