[msvc] Update csproj files (#4711)
[mono.git] / mcs / nunit24 / ConsoleRunner / nunit-console / ConsoleOptions.cs
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
6 \r
7 namespace NUnit.ConsoleRunner\r
8 {\r
9         using System;\r
10         using Codeblast;\r
11         using NUnit.Util;\r
12 \r
13         public class ConsoleOptions : CommandLineOptions\r
14         {\r
15                 public enum DomainUsage\r
16                 {\r
17                         Default,\r
18                         None,\r
19                         Single,\r
20                         Multiple\r
21                 }\r
22 \r
23                 [Option(Short="load", Description = "Test fixture to be loaded")]\r
24                 public string fixture;\r
25 \r
26                 [Option(Description = "Name of the test to run")]\r
27                 public string run;\r
28 \r
29                 [Option(Description = "Project configuration to load")]\r
30                 public string config;\r
31 \r
32                 [Option(Description = "Name of XML output file")]\r
33                 public string xml;\r
34 \r
35                 [Option(Description = "Name of transform file")]\r
36                 public string transform;\r
37 \r
38                 [Option(Description = "Display XML to the console")]\r
39                 public bool xmlConsole;\r
40 \r
41                 [Option(Short="out", Description = "File to receive test output")]\r
42                 public string output;\r
43 \r
44                 [Option(Description = "File to receive test error output")]\r
45                 public string err;\r
46 \r
47                 [Option(Description = "Label each test in stdOut")]\r
48                 public bool labels = false;\r
49 \r
50                 [Option(Description = "List of categories to include")]\r
51                 public string include;\r
52 \r
53                 [Option(Description = "List of categories to exclude")]\r
54                 public string exclude;\r
55 \r
56 //              [Option(Description = "Run in a separate process")]\r
57 //              public bool process;\r
58 \r
59                 [Option(Description = "AppDomain Usage for Tests")]\r
60                 public DomainUsage domain;\r
61 \r
62                 [Option(Description = "Disable shadow copy when running in separate domain")]\r
63                 public bool noshadow;\r
64 \r
65                 [Option (Description = "Disable use of a separate thread for tests")]\r
66                 public bool nothread;\r
67 \r
68                 [Option(Description = "Wait for input before closing console window")]\r
69                 public bool wait = false;\r
70 \r
71                 [Option(Description = "Do not display the logo")]\r
72                 public bool nologo = false;\r
73 \r
74                 [Option(Description = "Do not display progress" )]\r
75                 public bool nodots = false;\r
76 \r
77                 [Option(Short="?", Description = "Display help")]\r
78                 public bool help = false;\r
79 \r
80                 public ConsoleOptions( params string[] args ) : base( args ) {}\r
81 \r
82                 public ConsoleOptions( bool allowForwardSlash, params string[] args ) : base( allowForwardSlash, args ) {}\r
83 \r
84                 public bool Validate()\r
85                 {\r
86                         if(isInvalid) return false; \r
87 \r
88                         if(NoArgs) return true; \r
89 \r
90                         if(ParameterCount >= 1) return true; \r
91 \r
92                         return false;\r
93                 }\r
94 \r
95                 protected override bool IsValidParameter(string parm)\r
96                 {\r
97                         return NUnitProject.CanLoadAsProject( parm ) || PathUtils.IsAssemblyFileType( parm );\r
98                 }\r
99 \r
100 \r
101         public bool IsTestProject\r
102         {\r
103             get\r
104             {\r
105                 return ParameterCount == 1 && NUnitProject.CanLoadAsProject((string)Parameters[0]);\r
106             }\r
107         }\r
108 \r
109                 public override void Help()\r
110                 {\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
120                         base.Help();\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
125                 }\r
126         }\r
127 }