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