IGLib
1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
|
TextRunner is a general purpose class that runs tests and outputs to a text-based user interface (TextUI). More...
Public Member Functions | |
TextRunner (TextUI textUI, NUnitLiteOptions options) | |
Initializes a new instance of the TextRunner class. More... | |
int | Execute () |
int | Execute (Assembly callingAssembly) |
Execute a test run More... | |
void | ReportResults (ITestResult result) |
void | TestStarted (ITest test) |
Called when a test or suite has just started More... | |
void | TestFinished (ITestResult result) |
Called when a test has finished More... | |
Static Public Member Functions | |
static Dictionary< string, object > | MakeRunSettings (NUnitLiteOptions options) |
Make the settings for this run - this is public for testing More... | |
static TestFilter | CreateTestFilter (NUnitLiteOptions options) |
Create the test filter for this run - public for testing More... | |
Public Attributes | |
const int | OK = 0 |
OK More... | |
const int | INVALID_ARG = -1 |
Invalid Arguments More... | |
const int | FILE_NOT_FOUND = -2 |
File not found More... | |
const int | FIXTURE_NOT_FOUND = -3 |
Test fixture not found More... | |
const int | UNEXPECTED_ERROR = -100 |
Unexpected error occurred More... | |
Properties | |
ResultSummary | Summary [get, private set] |
Private Member Functions | |
int | RunTests (TestFilter filter, IDictionary runSettings) |
int | ExploreTests () |
Private Attributes | |
readonly List< Assembly > | _assemblies = new List<Assembly>() |
ITestAssemblyRunner | _runner |
NUnitLiteOptions | _options |
TeamCityEventListener | _teamCity |
TextUI | _textUI |
TextRunner is a general purpose class that runs tests and outputs to a text-based user interface (TextUI).
Call it from your Main like this: new TextRunner(textWriter).Execute(args); OR new TextUI().Execute(args); The provided TextWriter is used by default, unless the arguments to Execute override it using -out. The second form uses the Console, provided it exists on the platform.
NOTE: When running on a platform without a Console, such as Windows Phone, the results will simply not appear if you fail to specify a file in the call itself or as an option.
|
inline |
Initializes a new instance of the TextRunner class.
textUI | The text-based user interface to output results of the run |
options | The options to use when running the test |
|
inline |
Referenced by NUnitLite.AutoRun.Execute().
|
inline |
Execute a test run
callingAssembly | The assembly from which tests are loaded |
References NUnitLite.TextRunner.CreateTestFilter(), NUnitLite.TextUI.DisplayError(), NUnitLite.TextUI.DisplayTestFilters(), NUnit.Common.CommandLineOptions.Explore, NUnitLite.TextRunner.ExploreTests(), NUnitLite.TextRunner.FILE_NOT_FOUND, NUnit.Common.AssemblyHelper.GetAssemblyName(), NUnit.Common.CommandLineOptions.InputFiles, NUnit.Framework.Api.ITestAssemblyRunner.Load(), NUnit.Common.AssemblyHelper.Load(), NUnitLite.TextRunner.MakeRunSettings(), NUnitLite.TextRunner.OK, NUnitLite.TextRunner.RunTests(), and NUnitLite.TextRunner.UNEXPECTED_ERROR.
|
inlineprivate |
References NUnitLite.ResultSummary.ErrorCount, NUnitLite.ResultSummary.FailureCount, NUnitLite.ResultSummary.InvalidCount, NUnitLite.TextRunner.ReportResults(), NUnit.Common.CommandLineOptions.ResultOutputSpecifications, NUnit.Framework.Api.ITestAssemblyRunner.Run(), NUnitLite.TextRunner.Summary, NUnitLite.TextUI.TestFinished(), and NUnit.Common.CommandLineOptions.WorkDirectory.
Referenced by NUnitLite.TextRunner.Execute().
|
inline |
References NUnitLite.TextUI.DisplayErrorsAndFailuresReport(), NUnitLite.TextUI.DisplayNotRunReport(), NUnitLite.TextUI.DisplayRunSettings(), NUnitLite.TextUI.DisplaySummaryReport(), NUnitLite.ResultSummary.ExplicitCount, NUnit.Common.CommandLineOptions.Full, NUnitLite.ResultSummary.IgnoreCount, NUnit.Framework.Interfaces.ITestResult.ResultState, NUnitLite.ResultSummary.SkipCount, NUnit.Framework.Interfaces.ResultState.Status, and NUnitLite.TextRunner.Summary.
Referenced by NUnitLite.TextRunner.RunTests().
|
inlineprivate |
|
inlinestatic |
Make the settings for this run - this is public for testing
References NUnit.Common.CommandLineOptions.DefaultTimeout, NUnit.Common.PackageSettings.DefaultTimeout, NUnit.Common.CommandLineOptions.RandomSeed, NUnit.Common.PackageSettings.RandomSeed, NUnit.Common.CommandLineOptions.StopOnError, NUnit.Common.PackageSettings.StopOnError, NUnit.Common.PackageSettings.WorkDirectory, and NUnit.Common.CommandLineOptions.WorkDirectory.
Referenced by NUnitLite.TextRunner.Execute(), NUnitLite.Tests.MakeRunSettingsTests.WhenSeedIsSpecified_RunSettingsIncludeIt(), NUnitLite.Tests.MakeRunSettingsTests.WhenTimeoutIsSpecified_RunSettingsIncludeIt(), and NUnitLite.Tests.MakeRunSettingsTests.WhenWorkDirectoryIsSpecified_RunSettingsIncludeIt().
|
inlinestatic |
Create the test filter for this run - public for testing
options |
References NUnit.Framework.Interfaces.TNode.FromXml(), NUnit.Common.TestSelectionParser.Parse(), NUnit.Common.CommandLineOptions.TestList, NUnit.Common.CommandLineOptions.WhereClause, and NUnit.Common.CommandLineOptions.WhereClauseSpecified.
Referenced by NUnitLite.TextRunner.Execute(), NUnitLite.Tests.CreateTestFilterTests.GetFilter(), and NUnitLite.Tests.CreateTestFilterTests.TestListFileMissing().
|
inline |
Called when a test or suite has just started
test | The test that is starting |
Implements NUnit.Framework.Interfaces.ITestListener.
References NUnitLite.TeamCityEventListener.TestStarted().
|
inline |
Called when a test has finished
result | The result of the test |
Implements NUnit.Framework.Interfaces.ITestListener.
References NUnit.Framework.Interfaces.ITestResult.Output, NUnitLite.TeamCityEventListener.TestFinished(), and NUnitLite.TextUI.TestFinished().
const int NUnitLite.TextRunner.OK = 0 |
OK
Referenced by NUnitLite.AutoRun.Execute(), NUnitLite.TextRunner.Execute(), and NUnitLite.TextRunner.ExploreTests().
const int NUnitLite.TextRunner.INVALID_ARG = -1 |
Invalid Arguments
Referenced by NUnitLite.AutoRun.Execute().
const int NUnitLite.TextRunner.FILE_NOT_FOUND = -2 |
File not found
Referenced by NUnitLite.TextRunner.Execute().
const int NUnitLite.TextRunner.FIXTURE_NOT_FOUND = -3 |
Test fixture not found
const int NUnitLite.TextRunner.UNEXPECTED_ERROR = -100 |
Unexpected error occurred
Referenced by NUnitLite.TextRunner.Execute().
|
private |
|
private |
|
private |
|
private |
|
private |
|
getprivate set |
Referenced by NUnitLite.TextRunner.ReportResults(), and NUnitLite.TextRunner.RunTests().