You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

nunit.html 5.4 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us"></meta>
  4. <title>NUnit Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="dotnetexec">NUnit</a></h2>
  8. <h3>Description</h3>
  9. <p>Runs the <a href="http://www.nunit.org/">NUnit</a> console
  10. test runner.</p>
  11. <h3>Parameters</h3>
  12. <table border="1" cellpadding="2" cellspacing="0">
  13. <tr>
  14. <td valign="top"><b>Attribute</b></td>
  15. <td valign="top"><b>Description</b></td>
  16. <td align="center" valign="top"><b>Required</b></td>
  17. </tr>
  18. <tr>
  19. <td valign="top">vm</td>
  20. <td valign="top">Same as <a
  21. href="dotnetexec.html">dotnetexec</a>'s vm attribute.
  22. Specify the framework to use.</td>
  23. <td align="center">No.</td>
  24. </tr>
  25. <tr>
  26. <td valign="top">config</td>
  27. <td valign="top">Config file to use</td>
  28. <td align="center">No.</td>
  29. </tr>
  30. <tr>
  31. <td valign="top">output</td>
  32. <td valign="top">Where test output should go.</td>
  33. <td align="center">No.</td>
  34. </tr>
  35. <tr>
  36. <td valign="top">error</td>
  37. <td valign="top">Where test error output should go.</td>
  38. <td align="center">No.</td>
  39. </tr>
  40. <tr>
  41. <td valign="top">xmlout</td>
  42. <td valign="top">Where NUnit's XML output should go.</td>
  43. <td align="center">No.</td>
  44. </tr>
  45. <tr>
  46. <td valign="top">transform</td>
  47. <td valign="top">The transformation to apply.</td>
  48. <td align="center">No.</td>
  49. </tr>
  50. <tr>
  51. <td valign="top">thread</td>
  52. <td valign="top">Causes a separate thread to be created for
  53. running the tests - see the NUnit documentation for
  54. details.</td>
  55. <td align="center">No - defaults to false.</td>
  56. </tr>
  57. <tr>
  58. <td valign="top">noshadow</td>
  59. <td valign="top">Disables shadow copying of the assembly in
  60. order to provide improved performance..</td>
  61. <td align="center">No - defaults to false.</td>
  62. </tr>
  63. <tr>
  64. <td valign="top">fixture</td>
  65. <td valign="top">Test fixture to run.</td>
  66. <td align="center">No.</td>
  67. </tr>
  68. <tr>
  69. <td valign="top">labels</td>
  70. <td valign="top">Causes an identifying label to be displayed
  71. at the start of each test case.</td>
  72. <td align="center">No - defaults to false.</td>
  73. </tr>
  74. <tr>
  75. <td valign="top">failOnError</td>
  76. <td valign="top">Stops the build if NUnit returns with a code
  77. indicating an error or failure.</td>
  78. <td align="center">No - defaults to false.</td>
  79. </tr>
  80. </table>
  81. <h3>Parameters specified as nested elements</h3>
  82. <h4>testassembly</h4>
  83. <p><code>testassembly</code> has a single required attribute name -
  84. specifies an assembly or a project file holding tests.</p>
  85. <h4>include/exclude</h4>
  86. <p><code>in/exclude</code> have a single required attribute name -
  87. specifies a category to include or exclude from the tests.</p>
  88. <p><b>Note</b> that in current versions of NUnit (up to 2.2) you
  89. may choose to either include or exclude categories in a run, but
  90. not both. This task does <b>not</b> enforce this restriction
  91. since future versions of NUnit may change behavior.</p>
  92. <h4>redirector</h4>
  93. <p>A nested <a
  94. href="http://ant.apache.org/manual/CoreTypes/redirector.html">I/O
  95. Redirector</a> can be specified. Any file mapping is done using a
  96. <code>null</code> sourcefile; therefore not all <a
  97. href="http://ant.apache.org/manual/CoreTypes/mapper.html">Mapper</a>
  98. types will return results.</p>
  99. <h4>env</h4> <p>It is possible to specify environment variables to
  100. pass to the system command via nested <code>&lt;env&gt;</code>
  101. elements. They support the same attributes as the nested <a
  102. href="http://ant.apache.org/manual/CoreTasks/exec.html#env"><code>env</code>
  103. element of the <code>&lt;exec&gt;</code> task</a>.</p>
  104. <h3>Examples</h3>
  105. <h4>Specify an assembly or project:</h4>
  106. <pre>
  107. &lt;nunit&gt;
  108. &lt;testassembly name="nunit.tests.dll"/&gt;
  109. &lt;/nunit&gt;
  110. </pre>
  111. <p>or</p>
  112. <pre>
  113. &lt;nunit&gt;
  114. &lt;testassembly name="nunit.tests.csproj"/&gt;
  115. &lt;/nunit&gt;
  116. </pre>
  117. <h4>Specifying an Assembly and a Fixture</h4>
  118. <pre>
  119. &lt;nunit fixture="NUnit.Tests.AssertionTests"&gt;
  120. &lt;testassembly name="nunit.tests.dll"/&gt;
  121. &lt;/nunit&gt;
  122. </pre>
  123. <h4>Specifying Test Categories to Include</h4>
  124. <pre>
  125. &lt;nunit&gt;
  126. &lt;testassembly name="nunit.tests.dll"/&gt;
  127. &lt;include name="Baseline"/&gt;
  128. &lt;/nunit&gt;
  129. </pre>
  130. <h4>Specifying the XML file name</h4>
  131. <pre>
  132. &lt;nunit xmlout="console-test.xml"&gt;
  133. &lt;testassembly name="nunit.tests.dll"/&gt;
  134. &lt;/nunit&gt;
  135. </pre>
  136. <p>changes the name of the output file to "console-test.xml" -
  137. note that this task will resolve file names relative to the
  138. project's base directory, not the current working directory.</p>
  139. <h4>Specifying Multiple Assemblies</h4>
  140. <pre>
  141. &lt;nunit&gt;
  142. &lt;testassembly name="assembly1.dll"/&gt;
  143. &lt;testassembly name="assembly2.dll"/&gt;
  144. &lt;testassembly name="assembly3.dll"/&gt;
  145. &lt;/nunit&gt;
  146. </pre>
  147. <hr/>
  148. <p align="center">Copyright &copy; 2004 The Apache Software Foundation. All rights Reserved.</p>
  149. </body>
  150. </html>