source: BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/IHS BMX Framework/lib/NUnit/NUnit-2.5.10.11092/doc/configFiles.html@ 1146

Last change on this file since 1146 was 1146, checked in by Sam Habiel, 13 years ago

Initial Import of BMX4

File size: 6.1 KB
Line 
1<!-- saved from url=(0014)about:internet --><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2<html>
3<!-- Standard Head Part -->
4<head>
5<title>NUnit - ConfigFiles</title>
6<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
7<meta http-equiv="Content-Language" content="en-US">
8<link rel="stylesheet" type="text/css" href="nunit.css">
9<link rel="shortcut icon" href="favicon.ico">
10</head>
11<!-- End Standard Head Part -->
12
13<body>
14
15<!-- Standard Header for NUnit.org -->
16<div id="header">
17 <a id="logo" href="http://www.nunit.org"><img src="img/logo.gif" alt="NUnit.org" title="NUnit.org"></a>
18 <div id="nav">
19 <a href="http://www.nunit.org">NUnit</a>
20 <a class="active" href="index.html">Documentation</a>
21 </div>
22</div>
23<!-- End of Header -->
24
25<div id="content">
26
27<h2>Configuration Files</h2>
28
29<p>NUnit uses configuration files for the test runner executable – either nunit-console.exe or
30nunitgui.exe – as well as for the tests being run. Only settings that pertain to NUnit itself should be in
31the nunit-console.exe.config and nunit-gui.exe.config, while those that pertain to your own
32application and tests should be in a separate configuration file.</p>
33
34<h3>NUnit Configuration Files</h3>
35
36<p>One main purpose of the nunit-console and nunit-gui config files is to allow
37NUnit to run with various versions of the .NET framework. NUnit is built using
38versions 1.1 and 2.0 of the framework. The two builds are provided as separate
39downloads and either build can be made to run against other versions of the CLR.</p>
40
41<p>As delivered, the <startup> section of each config file is commented out,
42causing NUnit to run with the version of .NET used to build it. If you uncomment
43the <startup> section, the entries there control the order in which alternate
44framework versions are selected.</p>
45
46<h3>Test Configuration File</h3>
47
48<p>When a configuration file is used to provide settings or to control the environment in which a test
49is run, specific naming conventions must be followed.</p>
50
51<p>If a single assembly is being loaded, then the configuration file is given the name of the assembly
52file with the config extension. For example, the configuration file used to run nunit.tests.dll must
53be named nunit.tests.dll.config and located in the same directory as the dll.</p>
54
55<p>If an NUnit project is being loaded into a single AppDomain, the configuration file uses the
56name of the project file with the extension <i>changed</i> to config. For example, the project
57AllTests.nunit would require a configuration file named AllTests.config, located in the same
58directory as AllTests.nunit. The same rule is followed when loading Visual Studio projects or solutions.</p>
59
60<blockquote>
61<p><b>Note:</b> The above only applies if a single AppDomain is being used. If an NUnit
62project is loaded using a separate AppDomain for each assembly, then the individual
63configuration files for each of the assemblies are used.
64</blockquote>
65
66<p>Generally, you should be able to simply copy your application config file and rename it as
67described above.</p>
68
69<p>It is also possible to effect the behavior of NUnit by adding special sections
70to the test config file. A config file using these sections might look like this:
71
72<div class="code" style="width: 36em">
73<pre>
74&lt;?xml version="1.0" encoding="utf-8" ?&gt;
75&lt;configuration&gt;
76 &lt;configSections&gt;
77 &lt;sectionGroup name="NUnit"&gt;
78 &lt;section name="TestCaseBuilder"
79 type="System.Configuration.NameValueSectionHandler"/&gt;
80 &lt;section name="TestRunner"
81 type="System.Configuration.NameValueSectionHandler"/&gt;
82 &lt;/sectionGroup&gt;
83 &lt;/configSections&gt;
84
85 &lt;NUnit&gt;
86 &lt;TestCaseBuilder&gt;
87 &lt;add key="OldStyleTestCases" value="false" /&gt;
88 &lt;/TestCaseBuilder&gt;
89 &lt;TestRunner&gt;
90 &lt;add key="ApartmentState" value="MTA" /&gt;
91 &lt;add key="ThreadPriority" value="Normal" /&gt;
92 &lt;add key="DefaultLogThreshold" value="Error" /&gt;
93 &lt;/TestRunner&gt;
94 &lt;/NUnit&gt;
95
96 ...
97
98&lt;/configuration&gt;
99</pre>
100</div>
101
102<p>The entries in the above file are all
103set to default values. The meaning of each setting is as follows:
104
105<h4>OldStyleTestCases</h4>
106<p>If set to "true" NUnit will recognize methods beginning
107"test..." as tests. The prefix is case insensitive.
108
109<h4>ApartmentState</h4>
110<p>Sets the apartment state for the thread used to run tests.
111
112<h4>ThreadPriority</h4>
113<p>Sets the thread priority for the test thread.
114
115<h4>DefaultLogThreshold</h4>
116<p>Sets the level for logging captured by NUnit. In the
117current version only log4net logging is captured, so the
118level must be one that is defined by log4net.
119
120</div>
121
122<!-- Submenu -->
123<div id="subnav">
124<ul>
125<li><a href="index.html">NUnit 2.5.10</a></li>
126<ul>
127<li><a href="getStarted.html">Getting&nbsp;Started</a></li>
128<li><a href="assertions.html">Assertions</a></li>
129<li><a href="constraintModel.html">Constraints</a></li>
130<li><a href="attributes.html">Attributes</a></li>
131<li><a href="runningTests.html">Running&nbsp;Tests</a></li>
132<ul>
133<li><a href="nunit-console.html">Console&nbsp;Runner</a></li>
134<li><a href="nunit-gui.html">Gui&nbsp;Runner</a></li>
135<li><a href="pnunit.html">PNUnit&nbsp;Runner</a></li>
136<li><a href="nunit-agent.html">NUnit&nbsp;Agent</a></li>
137<li><a href="runtimeSelection.html">Runtime&nbsp;Selection</a></li>
138<li><a href="assemblyIsolation.html">Assembly&nbsp;Isolation</a></li>
139<li id="current"><a href="configFiles.html">Configuration&nbsp;Files</a></li>
140<li><a href="multiAssembly.html">Multiple&nbsp;Assemblies</a></li>
141<li><a href="vsSupport.html">Visual&nbsp;Studio&nbsp;Support</a></li>
142</ul>
143<li><a href="extensibility.html">Extensibility</a></li>
144<li><a href="releaseNotes.html">Release&nbsp;Notes</a></li>
145<li><a href="samples.html">Samples</a></li>
146<li><a href="license.html">License</a></li>
147</ul>
148</ul>
149</div>
150<!-- End of Submenu -->
151
152
153<!-- Standard Footer for NUnit.org -->
154<div id="footer">
155 Copyright &copy; 2010 Charlie Poole. All Rights Reserved.
156</div>
157<!-- End of Footer -->
158
159</body>
160</html>
Note: See TracBrowser for help on using the repository browser.