3
using System.Diagnostics;
4
using System.Threading;
5
using System.Threading.Tasks;
6
using System.Reflection;
8
using System.Xml.Serialization;
9
using AsyncTests.HttpClientAddin;
12
namespace AsyncTests.ConsoleRunner
20
public static void Main (string[] args)
22
Debug.AutoFlush = true;
23
Debug.Listeners.Add (new ConsoleTraceListener ());
26
string prefix = "http://localhost:8088/";
27
var p = new OptionSet ().
28
Add ("server", v => server = true).Add ("prefix=", v => prefix = v).
29
Add ("xml", v => xml = true);
32
var asm = typeof(AsyncTests.HttpClientTests.Simple).Assembly;
35
Server.Start (asm, prefix).Wait ();
36
Thread.Sleep (Timeout.Infinite);
42
} catch (Exception ex) {
43
Console.WriteLine ("ERROR: {0}", ex);
47
static async Task Run (Assembly assembly)
49
var suite = await TestSuite.Create (assembly);
50
var results = await suite.Run (CancellationToken.None);
51
WriteResults (results);
54
static void WriteResults (TestResultCollection results)
57
var serializer = new XmlSerializer (typeof(TestResultCollection));
58
serializer.Serialize (Console.Out, results);
61
ResultPrinter.Print (Console.Out, results);