Exemplo n.º 1
0
        protected override void ConfigureOptions()
        {
            base.ConfigureOptions();

            this.Add("config=", "{NAME} of a project configuration to load (e.g.: Debug).",
                     v => ActiveConfig = RequiredValue(v, "--config"));

            // Where to Run Tests
            this.Add("process=", "{PROCESS} isolation for test assemblies.\nValues: InProcess, Separate, Multiple. If not specified, defaults to Separate for a single assembly or Multiple for more than one.",
                     v =>
            {
                ProcessModel = RequiredValue(v, "--process", "Single", "InProcess", "Separate", "Multiple");
                // Change so it displays correctly even though it isn't absolutely needed
                if (ProcessModel.ToLowerInvariant() == "single")
                {
                    ProcessModel = "InProcess";
                }
            });

            this.Add("inprocess", "Synonym for --process:InProcess",
                     v => ProcessModel = "InProcess");

            this.Add("domain=", "{DOMAIN} isolation for test assemblies.\nValues: None, Single, Multiple. If not specified, defaults to Single for a single assembly or Multiple for more than one.",
                     v => DomainUsage = RequiredValue(v, "--domain", "None", "Single", "Multiple"));

            // How to Run Tests
            this.Add("framework=", "{FRAMEWORK} type/version to use for tests.\nExamples: mono, net-3.5, v4.0, 2.0, mono-4.0. If not specified, tests will run under the framework they are compiled with.",
                     v => Framework = RequiredValue(v, "--framework"));

            this.Add("x86", "Run tests in an x86 process on 64 bit systems",
                     v => RunAsX86 = v != null);

            this.Add("dispose-runners", "Dispose each test runner after it has finished running its tests.",
                     v => DisposeRunners = v != null);

            this.Add("shadowcopy", "Shadow copy test files",
                     v => ShadowCopyFiles = v != null);

            this.Add("loaduserprofile", "Load user profile in test runner processes",
                     v => LoadUserProfile = v != null);

            this.Add("skipnontestassemblies", "Skip any non-test assemblies specified, without error.",
                     v => SkipNonTestAssemblies = v != null);

            this.Add("agents=", "Specify the maximum {NUMBER} of test assembly agents to run at one time. If not specified, there is no limit.",
                     v => _maxAgents = RequiredInt(v, "--agents"));

            this.Add("debug", "Launch debugger to debug tests.",
                     v => DebugTests = v != null);

            this.Add("pause", "Pause before running to allow attaching a debugger.",
                     v => PauseBeforeRun = v != null);

            this.Add("list-extensions", "List all extension points and the extensions for each.",
                     v => ListExtensions = v != null);

            this.Add("set-principal-policy=", "Set PrincipalPolicy for the test domain.",
                     v => PrincipalPolicy = RequiredValue(v, "--set-principal-policy", "UnauthenticatedPrincipal", "NoPrincipal", "WindowsPrincipal"));

#if DEBUG
            this.Add("debug-agent", "Launch debugger in nunit-agent when it starts.",
                     v => DebugAgent = v != null);
#endif
        }