Пример #1
0
        private void goBtn_Click(object sender, EventArgs e)
        {
            int exitCode = 0;
            try
            {
                autoNewComboboxesItemsInHistory();
                configurator.saveSettings();
                errorScreen3.Text = configurator.getFilePath();

                cls();

                GoogleTestOutputParser parser = new GoogleTestOutputParser(this.advanceProgressBar, this.lineRead);

                bool monoException = false;
                try
                {
                    calibrateProgressBar(parser.countTests(runGtest(true).StandardOutput));

                    Process gtestexe = runGtest(false);
                    parser.parseTests(gtestexe.StandardOutput);

                    exitCode = gtestexe.ExitCode;
                }
                catch (System.ObjectDisposedException)
                {
                    monoException = true;
                }

                if (monoException)
                {
                    cls();
                    errorScreen3.Text = "Please Retry, Failure during run due to StreamReader close\n" +
                                        "(This is a known issue in Mono on Ubuntu.)";
                }
                else
                {
                    int disabled = (progressBar.Maximum - progressBar.Value);
                    
                    lineLabel.Text = "Done " + progressBar.Value + 
                                     " of " + progressBar.Maximum + 
                                     (disabled == 0 ? ". " : ". " + disabled + " are disabled.") +
                                     ". Pass: "******"%" ;
                    if (Failures.Count == 0 && exitCode == 0)
                    {
                        errorScreen3.Text = "All is well.";
                        isTestFail = false;
                    }
                    else
                    {
                        if (exitCode != 0)
                        {
                            isTestFail = true;
                            errorScreen3.Text = "Exit code != 0. Maybe an assertion failed.";
                        }
                    }
                        
                }
                goBtn.Enabled = canRun();
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }
Пример #2
0
        private void goBtn_Click(object sender, EventArgs e)
        {
            int exitCode = 0;

            try
            {
                autoNewComboboxesItemsInHistory();
                configurator.saveSettings();
                errorScreen3.Text = configurator.getFilePath();

                cls();

                GoogleTestOutputParser parser = new GoogleTestOutputParser(this.advanceProgressBar, this.lineRead);

                bool monoException = false;
                try
                {
                    calibrateProgressBar(parser.countTests(runGtest(true).StandardOutput));

                    Process gtestexe = runGtest(false);
                    parser.parseTests(gtestexe.StandardOutput);

                    exitCode = gtestexe.ExitCode;
                }
                catch (System.ObjectDisposedException)
                {
                    monoException = true;
                }

                if (monoException)
                {
                    cls();
                    errorScreen3.Text = "Please Retry, Failure during run due to StreamReader close\n" +
                                        "(This is a known issue in Mono on Ubuntu.)";
                }
                else
                {
                    int disabled = (progressBar.Maximum - progressBar.Value);

                    lineLabel.Text = "Done " + progressBar.Value +
                                     " of " + progressBar.Maximum +
                                     (disabled == 0 ? ". " : ". " + disabled + " are disabled.") +
                                     ". Pass: "******"%";
                    if (Failures.Count == 0 && exitCode == 0)
                    {
                        errorScreen3.Text = "All is well.";
                        isTestFail        = false;
                    }
                    else
                    {
                        if (exitCode != 0)
                        {
                            isTestFail        = true;
                            errorScreen3.Text = "Exit code != 0. Maybe an assertion failed.";
                        }
                    }
                }
                goBtn.Enabled = canRun();
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }