public static ITestRunner RegisterAsServer(ITestOutput output, Options options)
 {
     var host = new ServiceHost(output);
     int i;
     for (i = 0; i < 50; i += 10) {
         try {
             host.AddServiceEndpoint(typeof(ITestOutput), BindingFactory(), "http://localhost:" + (StartPort + i) + "/");
             break;
         } catch (AddressAlreadyInUseException) {
         }
     }
     host.Open();
     var start = DateTime.Now;
     Exception final = null;
     var res = new ChannelFactory<ITestRunner>(BindingFactory(), "http://localhost:" + (StartPort + i + 1) + "/").CreateChannel();
     while (DateTime.Now - start < TimeSpan.FromSeconds(5)) {
         try {
             res.Ping();
             return res;
         } catch (Exception e) {
             final = e;
         }
     }
     throw final;
 }
Exemple #2
0
        static void Main(string[] args)
        {
            var options = new Options(args);

            if (options.HasError) {
                Console.Error.WriteLine(options.Usage);
            } else if (options.IsChild) {
                new TestRunner(options).Complete.WaitOne();
            } else {
                Process runner = CreateChild(args, options.PipeName);
                new Thread(() => KeepAlive(runner)).Start();
                new TestServer(options, runner).Start();
            }
        }
Exemple #3
0
 public TestRunner(Options options)
 {
     Complete = new ManualResetEvent(false);
     _options = options;
     _output = ConnectionFactory.RegisterAsClient(this, options);
 }
Exemple #4
0
 public TestServer(Options options, Process runner)
 {
     _options = options;
     _runner = runner;
 }