NUnit
|    
* *
    |


Command-Line Parameters



Forms Interface
The forms interface has two command line options. If the program is started without any command line parameters it automatically loads the most recently loaded assembly. It does not automatically run it just loads the assembly. The forms interface also keeps track of the 5 most recently loaded assemblies. To access these see the File->Recent Assemblies menu item.

The other option is to specify the assembly on the command line. The following will start the forms interface with the assembly: nunit.tests.dll

nunit-gui.exe nunit.tests.dll


Console Interface
The console interface has a few additional options compared to the forms interface. The console program must always specify a command line parameter. The console interface always creates an XML representation of the test results. This file by default is called TestResult.xml and is placed in the working directory.

Note: By default the nunit-console program is not added to your path. You must do this manually if this is the desired behavior.

Specifying an Assembly
The console program must always have an assembly specified. To run the tests contained in the nunit.tests.dll use the following command:

nunit-console nunit.tests.dll

Specifying an Assembly and a Fixture
When specifying a a fixture, you must give the full name of the test fixture along with the containing assembly. For example, to run the NUnit.Tests.AssertionTests in the nunit.tests.dll assembly use the following command:

nunit-console /fixture:NUnit.Tests.AssertionTests nunit.tests.dll

Specifying the XML file name
As stated above, the console program always creates an XML representation of the test results. To change the name to "console-test.xml" use the following command line option:

nunit-console /xml:console-test.xml nunit.tests.dll

Specifying the Transform file
The console interface uses XSLT to transform the test results from the XML file to what is printed to the screen when the program executes. The console interface has a default transformation that is part of the executable. To specify your own transformation named "myTransform.xslt" use the following command line option:

nunit-console /transform:myTransform.xslt nunit.tests.dll

Note: For additional information see the XML schema for the test results. This file is in the same directory as the executable and is called Results.xsd. The default transform Summary.xslt is located in the core source directory.



Copyright © 2002-2004 James W. Newkirk, Alexei A. Vorontsov. All Rights Reserved.
|