
gallio.Gallio.NAntTasks.xml Maven / Gradle / Ivy
The newest version!
Gallio.NAntTasks
A NAnt task that provides support for running Gallio tests.
In order for NAnt to find this task, either the Gallio.NAntTasks.dll assembly needs
to be put in NAnt's bin folder, or it must be loaded with the loadtasks directive:
]]>
The following code is an example build file that shows how to load the task, specify the test files
and assemblies and set some of the task's properties:
The return code should have been 0!
]]>
Default constructor.
Executes the task.
Provided so that the unit tests can override test execution behavior.
Checks the result code of the tests execution and performs the
corresponding action.
The result code returned by the Run method of the
TestRunnerHelper class.
The list of test files, projects and assemblies to execute.
Wildcards may be used.
This is required.
The following example shows how to specify the test files, projects and assemblies
(for a more complete example please see the task documentation):
]]>
The list of directories used for loading referenced assemblies and other dependent resources.
The following example shows how to specify the hint directories:
]]>
Additional Gallio plugin directories to search recursively.
The following example shows how to specify the plugins directories:
]]>
Gets or sets the relative or absolute path of the application base directory,
or null to use a default value selected by the consumer.
If relative, the path is based on the current working directory,
so a value of "" causes the current working directory to be used.
The default is null.
Gets or sets the relative or absolute path of the working directory
or null to use a default value selected by the consumer.
If relative, the path is based on the current working directory,
so a value of "" causes the current working directory to be used.
The default is null.
Enables shadow copying when set to true.
Shadow copying allows the original assemblies to be modified while the tests are running.
However, shadow copying may occasionally cause some tests to fail if they depend on their original location.
The default is false.
Attaches the debugger to the test process when set to true.
The default is false.
Gets or sets the version of the .Net runtime to use for running tests.
For the CLR, this must be the name of one of the framework directories in %SystemRoot%\Microsoft.Net\Framework. eg. 'v2.0.50727'.
The default is null which uses the most recent installed and supported framework.
A list of the types of reports to generate, separated by semicolons.
- The types supported "out of the box" are: Html, Html-Inline, Text, XHtml,
XHtml-Inline, Xml, and Xml-Inline, but more types could be available as plugins.
- The report types are not case sensitives.
In the following example reports will be generated in both HTML and XML format.
]]>
Sets the report archive mode.
The supported modes are:
- Normal (default)
- Zip
In the following example, reports will be enclosed in a zip file:
]]>
Sets the format string to use to generate the reports filenames.
Any occurence of {0} will be replaced by the date, and any occurrence of {1} by the time.
The default format string is test-report-{0}-{1}.
Sets the name of the directory where the reports will be put.
The directory will be created if it doesn't exist. Existing files will be overwritten.
The default report directory is "Reports".
Sets whether to show generated reports in a window using the default system application
registered to the report file type.
Sets the type of test runner to use.
- The types supported "out of the box" are: Local, IsolatedAppDomain
and IsolatedProcess (default), but more types could be available as plugins.
- The runner types are not case sensitive.
Specifies the type, assembly, and parameters of custom test runner
extensions to use during the test run.
The value must be in the form '[Namespace.]Type,Assembly[;Parameters]'.
eg. 'FancyLogger,MyCustomExtensions.dll;SomeParameters'
The following example runs tests using a custom logger extension:
]]>
Specifies option property key/value pairs for the test runner.
The following example specifies some extra NCover arguments.
]]>
Specifies option property key/value pairs for the report formatter.
The following example changes the default attachment content disposition for the reports.
]]>
Sets whether to load the tests but not run them.
This option may be used to produce a
report that contains test metadata for consumption by other tools.
Sets whether to ignore annotations when determining the result code.
If false (default), then error annotations, usually indicative of broken tests, will cause
a failure result to be generated.
Sets whether to echo results to the screen as tests finish.
If this option is set to true, the default, test results are echoed to the console
in varying detail depending on the current verbosity level. Otherwise
only the final summary statistics are displayed.
Sets the maximum amount of time (in seconds) the tests can run
before they are canceled.
The default is an infinite time to run.
Sets the name of a NAnt property in which the exit code of the tests execution
should be stored.
Only of interest if FailOnError is set to false.
The return code should have been 0!
]]>
Sets the prefix that will be used for the statistics result properties.
The following properties are available:
AssertCount Gets the number of assertions evaluated.
FailedCount Gets the total number of test cases that were run and failed.
InconclusiveCount Gets the total number of test cases that ran and were inconclusive.
PassedCount Gets the total number of test cases that were run and passed.
SkippedCount Gets the total number of test cases that did not run because they were skipped.
RunCount Gets the total number of test cases that were run.
TestCount Gets the total number of test cases.
StepCount Gets the total number of test steps.
The following example shows how to use the result-properties-prefix property:
]]>
Sets the filter set to apply, which consists of a sequence of one or more inclusion
or exclusion filter rules prefixed using 'include' (optional) or 'exclude'.
A filter rule consists of zero or more filter expressions
that may be combined using 'and', 'or', and 'not' and grouped with
parentheses. A filter expression consists of a filter key followed by one or
more comma-delimited matching values in the form 'key: value, "quoted value",
/regular expression/'.
The filter grammar is defined as follows:
::= [^:,*()/\"']+
::= '"' .* '"' # String delimited by double quotation marks
| "'" .* "'" # String delimited by single quotation marks
::=
|
::= "/" .* "/" # Regular expression
| "/" .* "/i" # Case-insensitive regular expression
::=
::= # Value specified by exact string
| # Value specified by regular expression
::= (',' )* # One or more comma-separated values
::= "*" # "Any"
| ":" matchSeq>
| OR filterExpr> # Combine filter expressions with OR
| AND filterExpr> # Combine filter expressions with AND
| NOT # Negate filter expression
| "(" ")" # Grouping filter expression
::= # Inclusion rule (default case)
| INCLUDE # Inclusion rule
| EXCLUDE # Exclusion rule
::= # Filter set consists of at least one filter rule.
| # But may be a sequence of rules.
]]>
- By default this property takes the value "*", which means the "Any" filter will be applied.
-
The operator precedence is, from highest to lowest: NOT, AND, and OR. All these operators are
left-associative.
-
The commas used to separate the values are interpreted as OR operators, so "Type:Fixture1,Fixture2"
is equivalent to "Type:Fixture1 or Type:Fixture2".
-
White-space is ignored outside quoted strings, so "Type:Fixture1|Type:Fixture2" is equivalent
to "Type : Fixture1 | Type : Fixture2".
-
Commas, colons, slashes, backslashes and quotation marks can be escaped with a backslash. For
example, \' will be interpreted as '. Using a single backslash in front of any other character
is invalid.
-
Currently the following filter keys are recognized:
- Id: Filter by id.
- Name: Filter by name.
- Assembly: Filter by assembly name.
- Namespace: Filter by namespace name.
- Type: Filter by type name, including inherited types.
- ExactType: Filter by type name, excluding inherited types.
- Member: Filter by member name.
-
*: All other names are assumed to correspond to metadata keys. See
for standard metadata keys. Common keys are: AuthorName, Category, Description, Importance, TestsOn.
Assuming the following fixtures have been defined:
The following filters could be applied:
-
Type: Fixture1
All the tests within Fixture1 will be run.
-
Member: Test1
Only Fixture1.Test1 and Fixture2.Test1 will be run.
-
Type: Fixture1, Fixture2
All the tests within Fixture1 or Fixture2 will be run.
-
Type:Fixture1 or Type:Fixture2
All the tests within Fixture1 or Fixture2 will be run.
-
Type:Fixture1, Fixture2 and Member:Test2
Only Fixture1.Test2 and Fixture2.Test2 will be run.
-
Type:/Fixture*/ and Member:Test2
Only Fixture1.Test2 and Fixture2.Test2 will be run.
-
AuthorName:AlbertEinstein
All the tests within Fixture1 will be run because its author attribute is set to "AlbertEinstein".
-
Category: IntegrationTest
All the tests within Fixture2 will be run because its category attribute is set to "IntegrationTest".
-
("Type": 'Fixture1' and "Member":/Test*/) or (Type : Fixture2 and Member: /Test*/)
All the tests will be run. This example also shows that you can enclose key and
values with quotation marks, and group expressions with parentheses.
-
exclude AuthorName: AlbertEinstein
All the tests within Fixture2 will be run because its author attribute is not set to "AlbertEinstein".
-
exclude Type: Fixture2 include Member: Test2
Only Fixture1.Test2 will be run because Fixture2 was excluded from consideration before the inclusion rule was applied.
Controls the level of information logged.
The default is "Normal".
The return code should have been 0!
]]>
The Gallio.NAntTasks namespace contains NAnt tasks for Gallio.
An implementation that logs messages to a object.
A strongly-typed resource class, for looking up localized strings, etc.
Returns the cached ResourceManager instance used by this class.
Overrides the current thread's CurrentUICulture property for all
resource lookups using this strongly typed resource class.
Looks up a localized string similar to test-report-{0}-{1}.
Looks up a localized string similar to Gallio NAnt Task - Version {0}.
Looks up a localized string similar to Test Execution Failed.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy