Skip to content

Commit

Permalink
Merge pull request #802 from LimoWanKenobi/fake_nunit_documentation_i…
Browse files Browse the repository at this point in the history
…mprovements

NUnit documentation improvements
  • Loading branch information
forki committed May 20, 2015
2 parents 2d2071c + 5716dd3 commit 9fe7342
Show file tree
Hide file tree
Showing 4 changed files with 69 additions and 8 deletions.
2 changes: 1 addition & 1 deletion help/gettingstarted.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ Now all our projects will be compiled and we can use FAKE's NUnit task in order
// start build
RunTargetOrDefault "Default"

Our new *Test* target scans the test directory for test assemblies and runs them with the NUnit runner. FAKE automatically tries to locate the runner in one of your subfolders. See the [NUnit task documentation](apidocs/fake-nunitparallel.html) if you need to specify the tool path explicitly.
Our new *Test* target scans the test directory for test assemblies and runs them with the NUnit runner. FAKE automatically tries to locate the runner in one of your subfolders. See the [NUnit task documentation](apidocs/fake-nunitsequential.html) if you need to specify the tool path explicitly.

The mysterious part **(fun p -> ...)** simply overrides the default parameters of the NUnit task and allows to specify concrete parameters.

Expand Down
71 changes: 66 additions & 5 deletions src/app/FakeLib/UnitTest/NUnit/Common.fs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ open System.Text
/// Option which allows to specify if a NUnit error should break the build.
type NUnitErrorLevel = TestRunnerErrorLevel // a type alias to keep backwards compatibility

/// Process model for nunit to use, see http://www.nunit.org/index.php?p=projectEditor&r=2.5
/// Process model for nunit to use, see [Project Editor](http://www.nunit.org/index.php?p=projectEditor&r=2.6.4)
type NUnitProcessModel =
| DefaultProcessModel
| SingleProcessModel
Expand All @@ -21,7 +21,7 @@ type NUnitProcessModel =
| SingleProcessModel -> "Single"
| SeparateProcessModel -> "Separate"
| MultipleProcessModel -> "Multiple"
/// The /domain option controls of the creation of AppDomains for running tests. See http://www.nunit.org/index.php?p=consoleCommandLine&r=2.4.6
/// The /domain option controls of the creation of AppDomains for running tests. See [NUnit-Console Command Line Options](http://www.nunit.org/index.php?p=consoleCommandLine&r=2.6.4)
type NUnitDomainModel =
/// No domain is created - the tests are run in the primary domain. This normally requires copying the NUnit assemblies into the same directory as your tests.
| DefaultDomainModel
Expand All @@ -34,29 +34,90 @@ type NUnitDomainModel =
| DefaultDomainModel -> ""
| SingleDomainModel -> "Single"
| MultipleDomainModel -> "Multiple"
/// Parameter type for NUnit.

/// The [NUnit](http://www.nunit.org/) Console Parameters type.
/// FAKE will use [NUnitDefaults](fake-nunitcommon.html) for values not provided.
///
/// For reference, see: [NUnit-Console Command Line Options](http://www.nunit.org/index.php?p=consoleCommandLine&r=2.6.4)
type NUnitParams =
{ IncludeCategory : string
{
/// The [Categories](http://www.nunit.org/index.php?p=category&r=2.6.4) to be included in a test run. Multiple categories may be specified on either option, by using commas to separate them.
IncludeCategory : string

/// The [Categories](http://www.nunit.org/index.php?p=category&r=2.6.4) to be excluded in a test run. Multiple categories may be specified on either option, by using commas to separate them.
ExcludeCategory : string

/// The path to the NUnit console runner: `nunit-console.exe`
ToolPath : string

/// NUnit console runner name. ( `nunit-console.exe`)
ToolName : string

/// Suppresses use of a separate thread for running the tests and uses the main thread instead.
DontTestInNewThread : bool

/// Causes execution of the test run to terminate immediately on the first test failure or error.
StopOnError : bool

/// The output path of the nUnit XML report.
OutputFile : string

/// Redirects output created by the tests from standard output (console) to the file specified as value.
Out : string

/// Redirects error output created by the tests from standard error output (console) to the file specified as value.
ErrorOutputFile : string

/// Allows you to specify the version of the runtime to be used in executing tests.
Framework : string

/// Controls how NUnit loads tests in processes. See: [NUnitProcessModel](fake-nunitcommon-nunitprocessmodel.html).
ProcessModel : NUnitProcessModel

/// Causes an identifying label to be displayed at the start of each test case.
ShowLabels : bool

/// The working directory.
WorkingDir : string

/// The path to a custom XSLT transform file to be used to process the XML report.
XsltTransformFile : string

/// The default timeout to be used for test cases. If any test exceeds the timeout value, it is cancelled and reported as an error.
TimeOut : TimeSpan

/// Disables shadow copying of the assembly in order to provide improved performance.
DisableShadowCopy : bool

/// See [NUnitDomainModel](fake-nunitcommon-nunitdomainmodel.html).
Domain : NUnitDomainModel
/// Default: [TestRunnerErrorLevel](fake-unittestcommon-testrunnererrorlevel.html).Error
ErrorLevel : NUnitErrorLevel
/// Default: ""
Fixture: string}

/// NUnit default parameters. FAKE tries to locate nunit-console.exe in any subfolder.
/// The [NUnitParams](fake-nunitcommon-nunitparams.html) default parameters.
///
/// ## Defaults
/// - `IncludeCategory` - `""`
/// - `ExcludeCategory` - `""`
/// - `ToolPath` - `""`
/// - `ToolName` - `"nunit-console.exe"`
/// - `DontTestInNewThread`- `false`
/// - `StopOnError` - `false`
/// - `OutputFile` - The `nunit-console.exe` path if it exists in a subdirectory of the current directory.
/// - `Out` - `""`
/// - `ErrorOutputFile` - `""`
/// - `WorkingDir` - `""`
/// - `Framework` - `""`
/// - `ProcessModel` - `DefaultProcessModel`
/// - `ShowLabels` - `true`
/// - `XsltTransformFile` - `""`
/// - `TimeOut` - 5 minutes
/// - `DisableShadowCopy` - `false`
/// - `Domain` - `DefaultDomainModel`
/// - `ErrorLevel` - `Error`
/// - `Fixture` - `""`
let NUnitDefaults =
let toolname = "nunit-console.exe"
{ IncludeCategory = ""
Expand Down
2 changes: 1 addition & 1 deletion src/app/FakeLib/UnitTest/NUnit/Parallel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ type private AggFailedResult =
/// Runs NUnit in parallel on a group of assemblies.
/// ## Parameters
///
/// - `setParams` - Function used to manipulate the default NUnitParams value.
/// - `setParams` - Function used to manipulate the default [NUnitParams](fake-nunitcommon-nunitparams.html) value.
/// - `assemblies` - Sequence of one or more assemblies containing NUnit unit tests.
///
/// ## Sample usage
Expand Down
2 changes: 1 addition & 1 deletion src/app/FakeLib/UnitTest/NUnit/Sequential.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Fake.NUnitSequential
/// Runs NUnit on a group of assemblies.
/// ## Parameters
///
/// - `setParams` - Function used to manipulate the default NUnitParams value.
/// - `setParams` - Function used to manipulate the default [NUnitParams](fake-nunitcommon-nunitparams.html) value.
/// - `assemblies` - Sequence of one or more assemblies containing NUnit unit tests.
///
/// ## Sample usage
Expand Down

0 comments on commit 9fe7342

Please sign in to comment.