public void CollectTestCases(CTestInfo info)
 {
     info.Tests.Clear();
     if (!File.Exists(CTestExecutable))
     {
         return;
     }
     if (!Directory.Exists(CTestWorkingDir))
     {
         return;
     }
     var args = CTestArguments;
     if (!string.IsNullOrWhiteSpace(CurrentActiveConfig))
     {
         args += " -C ";
         args += CurrentActiveConfig;
     }
     var proc = new Process
     {
         StartInfo = new ProcessStartInfo()
         {
             FileName = CTestExecutable,
             WorkingDirectory = CTestWorkingDir,
             Arguments = args,
             CreateNoWindow = true,
             RedirectStandardError = true,
             RedirectStandardOutput = true,
             WindowStyle = ProcessWindowStyle.Hidden,
             UseShellExecute = false
         }
     };
     proc.Start();
     var output = proc.StandardOutput.ReadToEnd();
     proc.Dispose();
     var matches = TestRegex.Matches(output);
     foreach (var match in matches)
     {
         var m = match as Match;
         if (m == null)
         {
             continue;
         }
         var name = m.Groups[FieldNameTestname].Value;
         var numberStr = m.Groups[FieldNameNumber].Value;
         int number;
         int.TryParse(numberStr, out number);
         var newinfo = new CTestInfo.TestInfo
         {
             Name = name,
             Number = number,
         };
         info.Tests.Add(newinfo);
     }
 }
 public CTestContainerDiscoverer(
     [Import(typeof (SVsServiceProvider))] IServiceProvider serviceProvider)
     : base(serviceProvider, new CTestTestfileAddRemoveListener(), CTestExecutor.ExecutorUriString)
 {
     _log = new CTestLogWindow
     {
         Enabled = false,
         AutoRaise = false
     };
     _buildConfiguration = new BuildConfiguration(serviceProvider);
     _cmakeCache = new CMakeCache();
     _testCollector = new CTestTestCollector();
     _testInfo = new CTestInfo();
     _cmakeCache.CMakeCacheDir = _buildConfiguration.SolutionDir;
     _cmakeCache.CacheChanged += OnCMakeCacheChanged;
     _cmakeCache.StartWatching();
     _testCollector.CTestWorkingDir = _cmakeCache.CMakeCacheDir;
     _testCollector.CTestExecutable = _cmakeCache.CTestExecutable;
 }