Browse Source

Results from failed or ignored mspec tests are not duplicated.

pull/23/head
Tomasz Tretkowski 14 years ago
parent
commit
4aa6401747
  1. 7
      src/AddIns/Analysis/MachineSpecifications/MachineSpecifications/src/MSpecUnitTestMonitor.cs

7
src/AddIns/Analysis/MachineSpecifications/MachineSpecifications/src/MSpecUnitTestMonitor.cs

@ -13,6 +13,7 @@ namespace ICSharpCode.MachineSpecifications
{ {
public event TestFinishedEventHandler TestFinished; public event TestFinishedEventHandler TestFinished;
private FileSystemWatcher fileSystemWatcher; private FileSystemWatcher fileSystemWatcher;
private ISet<string> reportedResults;
public MSpecUnitTestMonitor() public MSpecUnitTestMonitor()
{ {
@ -35,6 +36,7 @@ namespace ICSharpCode.MachineSpecifications
var filter = FileName; var filter = FileName;
fileSystemWatcher = new FileSystemWatcher(Path.GetDirectoryName(FileName), Path.GetFileName(FileName)); fileSystemWatcher = new FileSystemWatcher(Path.GetDirectoryName(FileName), Path.GetFileName(FileName));
reportedResults = new HashSet<string>();
if (File.Exists(FileName)) if (File.Exists(FileName))
{ {
fileSystemWatcher.NotifyFilter = NotifyFilters.LastWrite; fileSystemWatcher.NotifyFilter = NotifyFilters.LastWrite;
@ -109,7 +111,10 @@ namespace ICSharpCode.MachineSpecifications
{ {
if (TestFinished != null) if (TestFinished != null)
foreach (var result in testResults) foreach (var result in testResults)
TestFinished(this, new TestFinishedEventArgs(result)); if (!reportedResults.Contains(result.Name)) {
TestFinished(this, new TestFinishedEventArgs(result));
reportedResults.Add(result.Name);
}
} }
public long InitialFilePosition { get; set; } public long InitialFilePosition { get; set; }

Loading…
Cancel
Save