summaryrefslogtreecommitdiffstats
path: root/tools/NUnit/doc/nunit-console.html
blob: 245436c88414e35a415bb2df41261c6d36cc7ebd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<!-- Standard Head Part -->
<head>
<title>NUnit - Nunit-console</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-US">
<link rel="stylesheet" type="text/css" href="nunit.css">
<link rel="shortcut icon" href="favicon.ico">
</head>
<!-- End Standard Head Part -->

<body>

<!-- Standard Header for NUnit.org -->
<div id="header">
  <a id="logo" href="http://www.nunit.org"><img src="img/logo.gif" alt="NUnit.org" title="NUnit.org"></a>
  <div id="nav">
    <a href="http://www.nunit.org">NUnit</a>
    <a class="active" href="index.html">Documentation</a>
  </div>
</div>
<!-- End of Header -->

<div id="content">

<h2>NUnit-Console</h2>
<p>The nunit-console.exe program is a text-based runner and can be used when you 
	want to run all your tests and don&#146;t need a red/yellow/green indication of 
	success or failure.</p>
<p>It is useful for automation of tests and integration into other systems. It 
	automatically saves its results in XML format, allowing you to produce reports 
	or otherwise process the results. The following is a screenshot of the console 
	program.</p>

<div class="screenshot-left">
      <img src="img/console-mock.jpg"></div>
<p>
<p>In this example, nunit-console has just run the tests in the mock-assembly.dll 
	that is part of the NUnit distribution. This assembly contains a number of tests, some
	of which are either ignored or marked explicit. The summary line shows the
	result of the test run. Click <a href="files/TestResult.xml">here</a> 
	to see the XML produced for this test run.</p>
	
<h3>NUnit-Console Return Codes</h3>

<p>Beginning with version 2.4.3, the nunit-console program returns negative
   values for any program errors. A zero return code indicates that there 
   were no errors and that all tests passed. A positive return code represents
   the number of test errors or failures.
   
<table class="constraints">
<tr><th>0</th><td>OK</td><td>Run completed with all tests passing</td></tr>
<tr><th>&gt; 0</th><td>FAILURE_COUNT</td><td>Run completed with one or more test failures</td></tr>
<tr><th>-1</th><td>INVALID_ARG</td><td>An invalid argument was passed to nunit-console</td></tr>
<tr><th>-2</th><td>FILE_NOT_FOUND</td><td>A file specified in the command line was not found</td></tr>
<tr><th>-3</th><td>FIXTURE_NOT_FOUND</td><td>A fixture specified in the command line was not found</td></tr>
</table>

<h3>X86 Version</h3>

<p>The .NET 2.0 version of the nunit-console program is built using /platform:anycpu,
which causes it to be jit-compiled to 32-bit code on a 32-bit system and 64-bit code 
on a 64 bit system. This causes an exception when NUnit is used to test a 32-bit
application on a 64-bit system. To avoid this problem, use the nunit-console-x86 
program, which is built using /platform:x86, when testing 32-bit code on a 
64-bit system.

</div>

<!-- Submenu -->
<div id="subnav">
<ul>
<li><a href="index.html">NUnit 2.5.5</a></li>
<ul>
<li><a href="getStarted.html">Getting&nbsp;Started</a></li>
<li><a href="assertions.html">Assertions</a></li>
<li><a href="constraintModel.html">Constraints</a></li>
<li><a href="attributes.html">Attributes</a></li>
<li><a href="runningTests.html">Running&nbsp;Tests</a></li>
<ul>
<li id="current"><a href="nunit-console.html">Console&nbsp;Runner</a></li>
<ul>
<li><a href="consoleCommandLine.html">Command-Line</a></li>
</ul>
<li><a href="nunit-gui.html">Gui&nbsp;Runner</a></li>
<li><a href="pnunit.html">PNUnit&nbsp;Runner</a></li>
<li><a href="runtimeSelection.html">Runtime&nbsp;Selection</a></li>
<li><a href="assemblyIsolation.html">Assembly&nbsp;Isolation</a></li>
<li><a href="configFiles.html">Configuration&nbsp;Files</a></li>
<li><a href="multiAssembly.html">Multiple&nbsp;Assemblies</a></li>
<li><a href="vsSupport.html">Visual&nbsp;Studio&nbsp;Support</a></li>
</ul>
<li><a href="extensibility.html">Extensibility</a></li>
<li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
<li><a href="samples.html">Samples</a></li>
<li><a href="license.html">License</a></li>
</ul>
</ul>
</div>
<!-- End of Submenu -->


<!-- Standard Footer for NUnit.org -->
<div id="footer">
  Copyright &copy; 2009 Charlie Poole. All Rights Reserved.
</div>
<!-- End of Footer -->

</body>
</html>