1 // ****************************************************************
2 // This is free software licensed under the NUnit license. You
3 // may obtain a copy of the license as well as information regarding
4 // copyright ownership at http://nunit.org/?p=license&r=2.4.
5 // ****************************************************************
7 namespace NUnit
.ConsoleRunner
13 public class ConsoleOptions
: CommandLineOptions
15 public enum DomainUsage
23 [Option(Short
="load", Description
= "Test fixture to be loaded")]
24 public string fixture
;
26 [Option(Description
= "Name of the test to run")]
29 [Option(Description
= "Project configuration to load")]
32 [Option(Description
= "Name of XML output file")]
35 [Option(Description
= "Name of transform file")]
36 public string transform
;
38 [Option(Description
= "Display XML to the console")]
39 public bool xmlConsole
;
41 [Option(Short
="out", Description
= "File to receive test output")]
44 [Option(Description
= "File to receive test error output")]
47 [Option(Description
= "Label each test in stdOut")]
48 public bool labels
= false;
50 [Option(Description
= "List of categories to include")]
51 public string include
;
53 [Option(Description
= "List of categories to exclude")]
54 public string exclude
;
56 // [Option(Description = "Run in a separate process")]
57 // public bool process;
59 [Option(Description
= "AppDomain Usage for Tests")]
60 public DomainUsage domain
;
62 [Option(Description
= "Disable shadow copy when running in separate domain")]
65 [Option (Description
= "Disable use of a separate thread for tests")]
68 [Option(Description
= "Wait for input before closing console window")]
69 public bool wait
= false;
71 [Option(Description
= "Do not display the logo")]
72 public bool nologo
= false;
74 [Option(Description
= "Do not display progress" )]
75 public bool nodots
= false;
77 [Option(Short
="?", Description
= "Display help")]
78 public bool help
= false;
80 public ConsoleOptions( params string[] args
) : base( args
) {}
82 public ConsoleOptions( bool allowForwardSlash
, params string[] args
) : base( allowForwardSlash
, args
) {}
84 public bool Validate()
86 if(isInvalid
) return false;
88 if(NoArgs
) return true;
90 if(ParameterCount
>= 1) return true;
95 protected override bool IsValidParameter(string parm
)
97 return NUnitProject
.CanLoadAsProject( parm
) || PathUtils
.IsAssemblyFileType( parm
);
101 public bool IsTestProject
105 return ParameterCount
== 1 && NUnitProject
.CanLoadAsProject((string)Parameters
[0]);
109 public override void Help()
112 Console
.WriteLine( "NUNIT-CONSOLE [inputfiles] [options]" );
114 Console
.WriteLine( "Runs a set of NUnit tests from the console." );
116 Console
.WriteLine( "You may specify one or more assemblies or a single" );
117 Console
.WriteLine( "project file of type .nunit." );
119 Console
.WriteLine( "Options:" );
122 Console
.WriteLine( "Options that take values may use an equal sign, a colon" );
123 Console
.WriteLine( "or a space to separate the option from its value." );