Source/Fusion/IntegrationTests/Program.cs
/// <summary>
/// The main program executes the tests. Output may be routed to
/// various locations, depending on the arguments passed.
/// </summary>
/// <remarks>Run with --help for a full list of arguments supported</remarks>
/// <param name="args"></param>
The main program executes the tests. Output may be routed to
various locations, depending on the arguments passed.
The main program executes the tests . Output may be routed to various locations depending on the arguments passed .
[STAThread]
		public static int Main(string[] args)
		{
			Thread.CurrentThread.SetInvariantCulture();
			ControlLeakTests._application = Application.Initialize(args);
			var log = new ReplaySubject<string>();
			var writer = new ConsoleAndDialogLogWriter(Console.Out);
			writer.Chunks.Subscribe(log);
			Console.SetOut(writer);
			int returnValue = -1;
			Application.Desktop.CreateSingletonWindow(
				isVisible: Observable.Return(true),
				window: window =>
				{
					ThreadPool.QueueUserWorkItem(
						_ =>
						{
							System.Threading.Thread.Sleep(300);
							returnValue = new AutoRun().Execute(args, new ExtendedTextWrapper(writer), Console.In);
							Application.Exit((byte)returnValue);
						});
					return new Window
					{
						Title = Observable.Return("Integration tests"),
						Content = LogView.Create(log.Select(s => s), Observable.Return(Color.Black))
							.WithHeight(200)
							.WithBackground(Color.White)
					};
				});
			Application.Run();
			return returnValue;
		}
[ STAThread ] public static int Main ( string [ ] args ) { Thread . CurrentThread . SetInvariantCulture ( ) ; ControlLeakTests . _application = Application . Initialize ( args ) ; var log = new ReplaySubject < string > ( ) ; var writer = new ConsoleAndDialogLogWriter ( Console . Out ) ; writer . Chunks . Subscribe ( log ) ; Console . SetOut ( writer ) ; int returnValue = - 1 ; Application . Desktop . CreateSingletonWindow ( isVisible : Observable . Return ( true ) , window : window => { ThreadPool . QueueUserWorkItem ( _ => { System . Threading . Thread . Sleep ( 300 ) ; returnValue = new AutoRun ( ) . Execute ( args , new ExtendedTextWrapper ( writer ) , Console . In ) ; Application . Exit ( ( byte ) returnValue ) ; } ) ; return new Window { Title = Observable . Return ( " " ) , Content = LogView . Create ( log . Select ( s => s ) , Observable . Return ( Color . Black ) ) . WithHeight ( 200 ) . WithBackground ( Color . White ) } ; } ) ; Application . Run ( ) ; return returnValue ; }
The main program executes the tests.
The main program executes the tests .
//Menu = Menu.Create(MenuItem.Create("Debug", createDebugWindow)),
args
string[]
None
remarks
Run with --help for a full list of arguments supported
Run with -- help for a full list of arguments supported