-
Notifications
You must be signed in to change notification settings - Fork 793
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add -silent reporter which does not output anything
- Loading branch information
1 parent
9cbad9a
commit dc28c5d
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
using Xunit.Abstractions; | ||
|
||
namespace Xunit.Runner.Reporters | ||
{ | ||
public class SilentReporter : IRunnerReporter | ||
{ | ||
public string Description => | ||
"turns off all output messages"; | ||
|
||
public bool IsEnvironmentallyEnabled => | ||
false; | ||
|
||
public string RunnerSwitch => | ||
"silent"; | ||
|
||
public IMessageSink CreateMessageHandler(IRunnerLogger logger) => | ||
new SilentReporterMessageHandler(); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/xunit.runner.reporters/SilentReporterMessageHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
using System.Collections.Generic; | ||
using Xunit.Abstractions; | ||
using Xunit.Sdk; | ||
|
||
namespace Xunit.Runner.Reporters | ||
{ | ||
public sealed class SilentReporterMessageHandler : LongLivedMarshalByRefObject, IMessageSinkWithTypes, IMessageSink | ||
{ | ||
public void Dispose() | ||
{ } | ||
|
||
public bool OnMessage(IMessageSinkMessage message) => | ||
true; | ||
|
||
public bool OnMessageWithTypes(IMessageSinkMessage message, HashSet<string> messageTypes) => | ||
true; | ||
} | ||
} |