示例#1
0
        public override bool Run()
        {
            StartLog("Tutorials");

            var testList = new List <string>();

            TabTests.GetCheckedTests(MainWindow.TutorialsTree.TopNode, testList);

            var args = new StringBuilder("offscreen=off loop=1 perftests=on language=");

            args.Append(MainWindow.GetCulture(MainWindow.TutorialsLanguage));
            if (MainWindow.ShowFormNamesTutorial.Checked)
            {
                args.Append(" showformnames=on");
            }
            if (MainWindow.ShowMatchingPagesTutorial.Checked)
            {
                args.Append(" showpages=on");
            }
            if (MainWindow.TutorialsDemoMode.Checked)
            {
                args.Append(" demo=on");
            }
            else
            {
                int pauseSeconds = -1;
                if (MainWindow.ModeTutorialsCoverShots.Checked)
                {
                    pauseSeconds = -2; // Magic number that tells TestRunner to grab tutorial cover shot then move on to next test
                }
                else if (MainWindow.PauseTutorialsScreenShots.Checked)
                {
                    int startingPage;
                    if (Int32.TryParse(MainWindow.PauseStartingPage.Text, out startingPage) && startingPage > 1)
                    {
                        args.Append(" startingpage=").Append(startingPage);
                    }
                }
                else if (!Int32.TryParse(MainWindow.PauseTutorialsSeconds.Text, out pauseSeconds))
                {
                    pauseSeconds = 0;
                }
                args.Append(" pause=").Append(pauseSeconds);
            }
            args.Append(" screenshotlist=\"");
            args.Append(Path.Combine(MainWindow.RootDir, "ScreenShotForms.txt"));
            args.Append("\" test=");
            args.Append(String.Join(",", testList));

            MainWindow.AddTestRunner(args.ToString());
            MainWindow.RunCommands();
            return(true);
        }
示例#2
0
        public override bool Run()
        {
            StartLog("Tutorials");

            var testList = new List <string>();

            TabTests.GetCheckedTests(MainWindow.TutorialsTree.TopNode, testList);

            var args = new StringBuilder("offscreen=off loop=1 language=");

            args.Append(MainWindow.GetCulture(MainWindow.TutorialsLanguage));
            if (MainWindow.ShowFormNamesTutorial.Checked)
            {
                args.Append(" showformnames=on");
            }
            if (MainWindow.ShowMatchingPagesTutorial.Checked)
            {
                args.Append(" showpages=on");
            }
            if (MainWindow.TutorialsDemoMode.Checked)
            {
                args.Append(" demo=on");
            }
            else
            {
                int pauseSeconds = -1;
                if (!MainWindow.PauseTutorialsScreenShots.Checked &&
                    !Int32.TryParse(MainWindow.PauseTutorialsSeconds.Text, out pauseSeconds))
                {
                    pauseSeconds = 0;
                }
                args.Append(" pause=");
                args.Append(pauseSeconds);
            }
            args.Append(" screenshotlist=\"");
            args.Append(Path.Combine(MainWindow.RootDir, "ScreenShotForms.txt"));
            args.Append("\" test=");
            args.Append(String.Join(",", testList));

            MainWindow.AddTestRunner(args.ToString());
            MainWindow.RunCommands();
            return(true);
        }
示例#3
0
        private void StartQuality()
        {
            _labels.Clear();
            _findTest.Clear();

            MainWindow.SetStatus("Running quality pass...");
            MainWindow.ResetElapsedTime();

            MainWindow.TestsRun = 0;

            MainWindow.CommandShell.LogFile = MainWindow.DefaultLogFile;
            if (File.Exists(MainWindow.DefaultLogFile))
            {
                Try.Multi <Exception>(() => File.Delete(MainWindow.DefaultLogFile), 4, false);
            }
            MainWindow.NewNightlyRun = _lastRun = new Summary.Run
            {
                Date = DateTime.Now
            };

            StartLog("Quality", MainWindow.DefaultLogFile);

            _updateTimer = new Timer {
                Interval = 300
            };
            _updateTimer.Tick += (s, a) => RunUI(UpdateQuality);
            _updateTimer.Start();

            var args = "offscreen=on quality=on{0} pass0={1} pass1={2} {3}{4}{5}".With(
                MainWindow.QualityPassDefinite.Checked ? " loop=" + int.Parse(MainWindow.QualityPassCount.Text) : "",
                MainWindow.Pass0.Checked.ToString(),
                MainWindow.Pass1.Checked.ToString(),
                MainWindow.QualityChooseTests.Checked ? TabTests.GetTestList() : "",
                MainWindow.QualityChooseTests.Checked ? " perftests=on" : "",  // In case any perf tests are explicitly selected - no harm if they aren't
                MainWindow.QualityRunSmallMoleculeVersions.Checked ? " runsmallmoleculeversions=on" : "",
                MainWindow.QualityAddSmallMoleculeNodes.Checked ? " testsmallmolecules=on" : "");

            MainWindow.AddTestRunner(args);

            MainWindow.RunCommands();
        }
        private void SkylineTesterWindow_Load(object sender, EventArgs e)
        {
            if (!Program.IsRunning)
                return; // design mode

            // Register file/exe/icon associations.
            var checkRegistry = Registry.GetValue(
                @"HKEY_CURRENT_USER\Software\Classes\SkylineTester\shell\open\command", null, null);
            Registry.SetValue(@"HKEY_CURRENT_USER\Software\Classes\SkylineTester\shell\open\command", null,
                Assembly.GetExecutingAssembly().Location.Quote() + @" ""%1""");
            Registry.SetValue(@"HKEY_CURRENT_USER\Software\Classes\.skyt", null, "SkylineTester");
            Registry.SetValue(@"HKEY_CURRENT_USER\Software\Classes\.skytr", null, "SkylineTester");

            // Refresh shell if association changed.
            if (checkRegistry == null)
                SHChangeNotify(0x08000000, 0x0000, IntPtr.Zero, IntPtr.Zero);

            _runButtons = new[]
            {
                runForms, runTutorials, runTests, runBuild, runQuality, runNightly
            };

            GetBuildPrerequisites();
            FindBuilds();

            commandShell.StopButton = buttonStop;
            commandShell.AddColorPattern("# ", Color.DarkGreen);
            commandShell.AddColorPattern("> ", Color.FromArgb(120, 120, 120));
            commandShell.AddColorPattern("...skipped ", Color.Orange);
            commandShell.AddColorPattern("...failed ", Color.Red);
            commandShell.AddColorPattern("!!!", Color.Red);
            commandShell.AddColorPatternEx("   at ", ":line ", Color.Blue);

            commandShell.ColorLine = line =>
            {
                if (line.StartsWith("...skipped ") ||
                    line.StartsWith("...failed ") ||
                    line.StartsWith("!!! "))
                {
                    _tabOutput.ProcessError(line);
                }
            };

            commandShell.FilterFunc = line =>
            {
                if (line == null)
                    return false;

                if (line.StartsWith("[MLRAW:"))
                    return false;

                // Filter out false error from Waters DLL (it's looking .ind, ultimately finds and uses .idx)
                if (line.StartsWith("Error opening index file") && line.EndsWith(".ind"))
                    return false;

                if (line.StartsWith("#@ "))
                {
                    // Update status.
                    RunUI(() =>
                    {
                        RunningTestName = line.Remove(0, "#@ Running ".Length).TrimEnd('.');
                        statusLabel.Text = line.Substring(3);
                    });
                    return false;
                }

                if (line.StartsWith("...skipped ") ||
                    line.StartsWith("...failed ") ||
                    line.StartsWith("!!! "))
                {
                    RunUI(() => _tabOutput.ProcessError(line));
                }

                if (NewNightlyRun != null)
                {
                    if (line.StartsWith("!!! "))
                    {
                        var parts = line.Split(' ');
                        if (parts[2] == "LEAKED" || parts[2] == "CRT-LEAKED")
                            NewNightlyRun.Leaks++;
                    }
                    else if (line.Length > 6 && line[0] == '[' && line[6] == ']' && line.Contains(" failures, "))
                    {
                        lock (NewNightlyRun)
                        {
                            LastTestResult = line;
                            TestsRun++;
                        }
                    }
                }

                return true;
            };

            if (_openFile != null)
                LoadSettingsFromFile(_openFile);

            TabBase.MainWindow = this;
            _tabForms = new TabForms();
            _tabTutorials = new TabTutorials();
            _tabTests = new TabTests();
            _tabBuild = new TabBuild();
            _tabQuality = new TabQuality();
            _tabNightly = new TabNightly();
            _tabOutput = new TabOutput();
            _tabRunStats = new TabRunStats();

            _tabs = new TabBase[]
            {
                _tabForms,
                _tabTutorials,
                _tabTests,
                _tabBuild,
                _tabQuality,
                _tabNightly,
                _tabOutput,
                _tabRunStats
            };
            NightlyTabIndex = Array.IndexOf(_tabs, _tabNightly);

            InitQuality();
            _previousTab = tabs.SelectedIndex;
            _tabs[_previousTab].Enter();
            statusLabel.Text = "";

            var loader = new BackgroundWorker();
            loader.DoWork += BackgroundLoad;
            loader.RunWorkerAsync();
        }