Пример #1
0
        private void RunAllTestCases(TestCaseSet testCaseSet, bool onlyRunSelected, bool baseline)
        {
            if (!CheckAllCommandFileExist())
            {
                return;
            }

            List <TestCase> testCaseList = testCaseSet.TestCaseList;

            //FileInfo file = new FileInfo(testCaseSet.TestCaseFilePath);
            //DirectoryInfo outputDir = new DirectoryInfo(
            //    Path.Combine(file.DirectoryName, OutputDirectory));
            //if (!outputDir.Exists)
            //    outputDir.Create();
            if (m_runTestCaseThread != null && m_runTestCaseThread.IsAlive)
            {
                MessageBox.Show("Stop running test case first.");
                return;
            }
            m_runTestCaseThread = new Thread(delegate() {
                this.Invoke(m_enableRunMenuItemDelegate, new object[] { false });
                try
                {
                    for (int i = 0; i < testCaseList.Count; i++)
                    {
                        if (!onlyRunSelected ||
                            dataGridViewTestCases.Rows[i].Cells[0].EditedFormattedValue.ToString() == "True")
                        {
                            TestCaseRunner runner = new TestCaseRunner(testCaseList[i], m_settings, i + 1);
                            runner.Run(baseline);
                        }
                    }
                }
                catch (ThreadAbortException)
                {
                }
                finally
                {
                    ChangeRunningTestCases2Untested(testCaseList);
                    this.Invoke(m_enableRunMenuItemDelegate, new object[] { true });
                }
            });
            m_runTestCaseThread.IsBackground = true;
            m_runTestCaseThread.Start();
        }
Пример #2
0
        private void RunAllTestCases(TestCaseSet testCaseSet, bool onlyRunSelected)
        {
            if (!CheckAllCommandFileExist())
                return;

            List<TestCase> testCaseList = testCaseSet.TestCaseList;
            //FileInfo file = new FileInfo(testCaseSet.TestCaseFilePath);
            //DirectoryInfo outputDir = new DirectoryInfo(
            //    Path.Combine(file.DirectoryName, OutputDirectory));
            //if (!outputDir.Exists)
            //    outputDir.Create();
            if (m_runTestCaseThread != null && m_runTestCaseThread.IsAlive)
            {
                MessageBox.Show("Stop running test case first.");
                return;
            }
            m_runTestCaseThread = new Thread(delegate() {
                this.Invoke(m_enableRunMenuItemDelegate, new object[] { false });
                try
                {
                    for (int i = 0; i < testCaseList.Count; i++)
                    {
                        if (!onlyRunSelected ||
                            dataGridViewTestCases.Rows[i].Cells[0].EditedFormattedValue.ToString() == "True")
                        {
                            TestCaseRunner runner = new TestCaseRunner(testCaseList[i],
                                m_settings, i+1);
                            runner.Run();
                        }
                    }
                }
                catch (ThreadAbortException)
                {
                }
                finally
                {
                    ChangeRunningTestCases2Untested(testCaseList);
                    this.Invoke(m_enableRunMenuItemDelegate, new object[] { true });
                }
            });
            m_runTestCaseThread.IsBackground = true;
            m_runTestCaseThread.Start();
        }