Exemplo n.º 1
0
        static void Main(string[] args)
        {
            //args = new string[] { @"--input=C:\Users\ack\AppData\Local\Temp\tmp15F1.tmp", @"--output=C:\Users\ack\AppData\Local\Temp\tmp4463.tmp", "--startsuspended", "--silent" };
            //args = new string[] { @"--input=C:\Users\ack\AppData\Local\Temp\tmpCC98.tmp", @"--output=C:\Users\ack\AppData\Local\Temp\tmpA3BA.tmp" };
            //args = new string[] { @"--input=C:\Users\ack\AppData\Local\Temp\tmp639.tmp", @"--output=C:\Users\ack\AppData\Local\Temp\tmpB02D.tmp" };
            _mainThreadID = Thread.CurrentThread.ManagedThreadId;
            var parser = new ArgumentParser(args);
            _arguments = parser.Parse();
            if (_arguments.Logging)
                Logger.SetLogger(new ConsoleLogger());
            writeHeader();
            if (!File.Exists(_arguments.InputFile) || _arguments.OutputFile == null)
            {
                printUseage();
                return;
            }
            Write("Test run options:");
            Write(File.ReadAllText(_arguments.InputFile));
            if (_arguments.StartSuspended)
                Console.ReadLine();
            tryRunTests();
            Write(" ");
            if (File.Exists(_arguments.OutputFile))
            {
                Write("Test run result:");
                Write(File.ReadAllText(_arguments.OutputFile));
            }

			// We do this since NUnit threads some times keep staing in running mode even after finished.
            killHaltedThreads();
            System.Diagnostics.Process.GetCurrentProcess().Kill();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            _mainThreadID = Thread.CurrentThread.ManagedThreadId;
            var parser = new ArgumentParser(args);
            _arguments = parser.Parse();
            if (_arguments.Logging)
                Logger.SetLogger(new ConsoleLogger());
            //Logger.SetLogger(new FileLogger(true, Path.Combine(getPath(), "runner.log." + DateTime.Now.Ticks.ToString())));
            writeHeader();
            if (!File.Exists(_arguments.InputFile) || _arguments.OutputFile == null)
            {
                printUseage();
                return;
            }
            Write("Test run options:");
            Write(File.ReadAllText(_arguments.InputFile));
            if (_arguments.StartSuspended)
                Console.ReadLine();
            tryRunTests();
            Write(" ");
            if (File.Exists(_arguments.OutputFile))
            {
                Write("Test run result:");
                Write(File.ReadAllText(_arguments.OutputFile));
            }

			// We do this since NUnit threads some times keep staing in running mode even after finished.
            killHaltedThreads();
            System.Diagnostics.Process.GetCurrentProcess().Kill();
        }
 public void Should_get_default_channel()
 {
     var parser = new ArgumentParser(new string[] { "--silent" });
     var arguments = parser.Parse();
     Assert.That(arguments.Channel, Is.EqualTo("AutoTest.TestRunner." + Process.GetCurrentProcess().Id.ToString()));
 }
 public void Should_parse_channel()
 {
     var parser = new ArgumentParser(new string[] { "--channel=\"Some Channel\"" });
     var arguments = parser.Parse();
     Assert.That(arguments.Channel, Is.EqualTo("Some Channel"));
 }
 public void Should_parse_logging()
 {
     var parser = new ArgumentParser(new string[] { "--logging" });
     var arguments = parser.Parse();
     Assert.That(arguments.Logging, Is.True);
 }
 public void Should_parse_silent()
 {
     var parser = new ArgumentParser(new string[] { "--silent" });
     var arguments = parser.Parse();
     Assert.That(arguments.Silent, Is.True);
 }
 public void Should_parse_start_suspended()
 {
     var parser = new ArgumentParser(new string[] { "--startsuspended" });
     var arguments = parser.Parse();
     Assert.That(arguments.StartSuspended, Is.True);
 }
 public void Should_parse_output_file()
 {
     var parser = new ArgumentParser(new string[] { "--output=\"C:\\somewhere\\something.meh\"" });
     var arguments = parser.Parse();
     Assert.That(arguments.OutputFile, Is.EqualTo("C:\\somewhere\\something.meh"));
 }