diff options
author | Chris Hamons <chris.hamons@xamarin.com> | 2014-05-14 20:09:42 +0400 |
---|---|---|
committer | Chris Hamons <chris.hamons@xamarin.com> | 2014-05-14 20:09:42 +0400 |
commit | e6ce4d81067b8b9085947f16bd0236636ad91813 (patch) | |
tree | dfd0df9409581cf0f1aeb9e0348ddeac17388ab4 | |
parent | acbd73e0c808664cf7c39788e559ee199ceb3da1 (diff) |
Report if -run: filter matches zero tests instead of reporting success
-rw-r--r-- | .gitignore | 2 | ||||
-rwxr-xr-x | src/framework/Internal/Filters/SimpleNameFilter.cs | 15 | ||||
-rwxr-xr-x | src/framework/Internal/WorkItems/CompositeWorkItem.cs | 5 |
3 files changed, 22 insertions, 0 deletions
@@ -2,3 +2,5 @@ bin src/framework/GuiUnit.userprefs src/framework/obj/* +*.userprefs +src/TestResultConsole/obj/* diff --git a/src/framework/Internal/Filters/SimpleNameFilter.cs b/src/framework/Internal/Filters/SimpleNameFilter.cs index 6deecf5..becc675 100755 --- a/src/framework/Internal/Filters/SimpleNameFilter.cs +++ b/src/framework/Internal/Filters/SimpleNameFilter.cs @@ -22,6 +22,9 @@ // *********************************************************************** using System; +using System.Text; + + #if CLR_2_0 || CLR_4_0 using System.Collections.Generic; #endif @@ -88,5 +91,17 @@ namespace NUnit.Framework.Internal.Filters return true; return false; } + + /// <summary> + /// Returns a <see cref="System.String"/> that represents the current <see cref="NUnit.Framework.Internal.Filters.SimpleNameFilter"/>. + /// </summary> + /// <returns>A <see cref="System.String"/> that represents the current <see cref="NUnit.Framework.Internal.Filters.SimpleNameFilter"/>.</returns> + public override string ToString () + { + StringBuilder s = new StringBuilder("[SimpleNameFilter]: "); + foreach (var name in names) + s.Append (name + " "); + return s.ToString (); + } } } diff --git a/src/framework/Internal/WorkItems/CompositeWorkItem.cs b/src/framework/Internal/WorkItems/CompositeWorkItem.cs index 0438fad..c8a2a7a 100755 --- a/src/framework/Internal/WorkItems/CompositeWorkItem.cs +++ b/src/framework/Internal/WorkItems/CompositeWorkItem.cs @@ -88,6 +88,11 @@ namespace NUnit.Framework.Internal.WorkItems RunChildren(); return; } + else + { + Console.WriteLine("No tests found that match filter: " + _childFilter.ToString() + "\n"); + Result.SetResult(ResultState.Inconclusive); + } } // Fall through in case there were no child tests to run. |