1 // ***********************************************************************
2 // Copyright (c) 2014 Charlie Poole
4 // Permission is hereby granted, free of charge, to any person obtaining
5 // a copy of this software and associated documentation files (the
6 // "Software"), to deal in the Software without restriction, including
7 // without limitation the rights to use, copy, modify, merge, publish,
8 // distribute, sublicense, and/or sell copies of the Software, and to
9 // permit persons to whom the Software is furnished to do so, subject to
10 // the following conditions:
12 // The above copyright notice and this permission notice shall be
13 // included in all copies or substantial portions of the Software.
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
19 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
20 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 // ***********************************************************************
25 #define NUNIT_FRAMEWORK
29 namespace NUnit.Common
32 /// PackageSettings is a static class containing constant values that
33 /// are used as keys in setting up a TestPackage. These values are used in
34 /// the engine and framework. Setting values may be a string, int or bool.
36 public static class PackageSettings
38 #region Common Settings - Used by both the Engine and the 3.0 Framework
41 /// Flag (bool) indicating whether tests are being debugged.
43 public const string DebugTests = "DebugTests";
46 /// Flag (bool) indicating whether to pause execution of tests to allow
47 /// the user to attache a debugger.
49 public const string PauseBeforeRun = "PauseBeforeRun";
52 /// The InternalTraceLevel for this run. Values are: "Default",
53 /// "Off", "Error", "Warning", "Info", "Debug", "Verbose".
54 /// Default is "Off". "Debug" and "Verbose" are synonyms.
56 public const string InternalTraceLevel = "InternalTraceLevel";
59 /// Full path of the directory to be used for work and result files.
60 /// This path is provided to tests by the frameowrk TestContext.
62 public const string WorkDirectory = "WorkDirectory";
66 #region Engine Settings - Used by the Engine itself
69 /// The name of the config to use in loading a project.
70 /// If not specified, the first config found is used.
72 public const string ActiveConfig = "ActiveConfig";
75 /// Bool indicating whether the engine should determine the private
76 /// bin path by examining the paths to all the tests. Defaults to
77 /// true unless PrivateBinPath is specified.
79 public const string AutoBinPath = "AutoBinPath";
82 /// The ApplicationBase to use in loading the tests. If not
83 /// specified, and each assembly has its own process, then the
84 /// location of the assembly is used. For multiple assemblies
85 /// in a single process, the closest common root directory is used.
87 public const string BasePath = "BasePath";
90 /// Path to the config file to use in running the tests.
92 public const string ConfigurationFile = "ConfigurationFile";
95 /// Bool flag indicating whether a debugger should be launched at agent
96 /// startup. Used only for debugging NUnit itself.
98 public const string DebugAgent = "DebugAgent";
101 /// Indicates how to load tests across AppDomains. Values are:
102 /// "Default", "None", "Single", "Multiple". Default is "Multiple"
103 /// if more than one assembly is loaded in a process. Otherwise,
106 public const string DomainUsage = "DomainUsage";
109 /// The private binpath used to locate assemblies. Directory paths
110 /// is separated by a semicolon. It's an error to specify this and
111 /// also set AutoBinPath to true.
113 public const string PrivateBinPath = "PrivateBinPath";
116 /// The maximum number of test agents permitted to run simultneously.
117 /// Ignored if the ProcessModel is not set or defaulted to Multiple.
119 public const string MaxAgents = "MaxAgents";
122 /// Indicates how to allocate assemblies to processes. Values are:
123 /// "Default", "Single", "Separate", "Multiple". Default is "Multiple"
124 /// for more than one assembly, "Separate" for a single assembly.
126 public const string ProcessModel = "ProcessModel";
129 /// Indicates the desired runtime to use for the tests. Values
130 /// are strings like "net-4.5", "mono-4.0", etc. Default is to
131 /// use the target framework for which an assembly was built.
133 public const string RuntimeFramework = "RuntimeFramework";
136 /// Bool flag indicating that the test should be run in a 32-bit process
137 /// on a 64-bit system. By default, NUNit runs in a 64-bit process on
138 /// a 64-bit system. Ignored if set on a 32-bit system.
140 public const string RunAsX86 = "RunAsX86";
143 /// Indicates that test runners should be disposed after the tests are executed
145 public const string DisposeRunners = "DisposeRunners";
148 /// Bool flag indicating that the test assemblies should be shadow copied.
149 /// Defaults to false.
151 public const string ShadowCopyFiles = "ShadowCopyFiles";
154 /// Bool flag indicating that user profile should be loaded on test runner processes
156 public const string LoadUserProfile = "LoadUserProfile";
159 #region Framework Settings - Passed through and used by the 3.0 Framework
162 /// Integer value in milliseconds for the default timeout value
163 /// for test cases. If not specified, there is no timeout except
164 /// as specified by attributes on the tests themselves.
166 public const string DefaultTimeout = "DefaultTimeout";
169 /// A TextWriter to which the internal trace will be sent.
171 public const string InternalTraceWriter = "InternalTraceWriter";
174 /// A list of tests to be loaded.
177 public const string LOAD = "LOAD";
180 /// The number of test threads to run for the assembly. If set to
181 /// 1, a single queue is used. If set to 0, tests are executed
182 /// directly, without queuing.
184 public const string NumberOfTestWorkers = "NumberOfTestWorkers";
187 /// The random seed to be used for this assembly. If specified
188 /// as the value reported from a prior run, the framework should
189 /// generate identical random values for tests as were used for
190 /// that run, provided that no change has been made to the test
191 /// assembly. Default is a random value itself.
193 public const string RandomSeed = "RandomSeed";
196 /// If true, execution stops after the first error or failure.
198 public const string StopOnError = "StopOnError";
201 /// If true, use of the event queue is suppressed and test events are synchronous.
203 public const string SynchronousEvents = "SynchronousEvents";
206 /// The default naming pattern used in generating test names
208 public const string DefaultTestNamePattern = "DefaultTestNamePattern";
211 /// Parameters to be passed on to the test
213 public const string TestParameters = "TestParameters";
217 #region Internal Settings - Used only within the engine
220 /// If the package represents an assembly, then this is the CLR version
221 /// stored in the assembly image. If it represents a project or other
222 /// group of assemblies, it is the maximum version for all the assemblies.
224 public const string ImageRuntimeVersion = "ImageRuntimeVersion";
227 /// True if any assembly in the package requires running as a 32-bit
228 /// process when on a 64-bit system.
230 public const string ImageRequiresX86 = "ImageRequiresX86";
233 /// True if any assembly in the package requires a special assembly resolution hook
234 /// in the default AppDomain in order to find dependent assemblies.
236 public const string ImageRequiresDefaultAppDomainAssemblyResolver = "ImageRequiresDefaultAppDomainAssemblyResolver";
239 /// The FrameworkName specified on a TargetFrameworkAttribute for the assembly
241 public const string ImageTargetFrameworkName = "ImageTargetFrameworkName";