public override void Execute(IEnumerable <string> args) { try { var options = Parse(args); ExitCode = options != null ? UnoTest.DiscoverAndRun(options) : -1; } catch (HttpListenerException e) { Log.Error("Failed to open network socket for test communication: " + e.Message); Log.WriteErrorLine( "If you're trying to run your tests on an external device, remember to run 'uno test' as Administrator."); ExitCode = 1; } catch (ArgumentException e) { Log.Error("Invalid argument: " + e.Message); ExitCode = 1; } catch (AggregateException) { Log.Error("Internal error(s) occured."); ExitCode = 1; } catch (Exception e) { Log.Error("Exited with exception: " + e.Message); ExitCode = 1; } }
public static int Main(string[] args) { try { var options = CommandLineOptions.From(args); return(options == null ? -1 : UnoTest.DiscoverAndRun(options) ? 1 : 0); } catch (HttpListenerException e) { Console.Error.WriteLine("Failed to open network socket for test communication: " + e.Message); Console.Error.WriteLine( "If you're trying to run your tests on an external device, remember to run UnoTest as Administrator."); return(1); } catch (ArgumentException e) { Console.Error.WriteLine("Invalid argument: " + e.Message); return(1); } catch (AggregateException) { Console.Error.WriteLine("Internal error(s) occured."); return(1); } catch (Exception e) { Console.Error.WriteLine("Exited with exception: " + e.Message); return(1); } }