Ejemplo n.º 1
0
            public void Cancel()
            {
                s.Cancel();
                d.Dispose();
                worker.Dispose();

                if (QueueDrainHelper.Enter(ref wip))
                {
                    queue.Clear();
                    buffer = null;
                }
            }
 public void Cancel()
 {
     s.Cancel();
     worker.Dispose();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// Call RunTestCase runsCnt times, reset in between runs.
        /// </summary>
        /// <exception cref="ConformanceTesterException">Is thrown when Run does not finish normally</exception>
        public void Run()
        {
            bool reset = false;

            try
            {
                int run = 0;
                while ((runsCnt <= 0) || run < runsCnt)
                {
                    TestResult testResult = RunTestCase(run);

                    // Tests results summary metrics
                    if (testResult.verdict == Verdict.Failure)
                    {
                        ++totalFailedTests;
                    }

                    // Requirements metrics
                    totalExecutedRequirements = totalExecutedRequirements.Union(testResult.executedRequirements);

                    if (!this.testResultNotifier(testResult))
                    {
                        Reset();

                        //Metrics
                        AddMetricsToEndOfLog();

                        return;
                    }
                    Reset();
                    run += 1;

                    // Tests results summary metrics
                    totalExecutedTests = run;
                }

                // Metrics
                AddMetricsToEndOfLog();
            }
            catch (Exception e)
            {
                if (e.Message != "Reset failed.")
                {
                    reset = true;
                }
                if (e is ConformanceTesterException)
                {
                    throw;
                }
                throw new ConformanceTesterException("Run failed. " + e.Message);
            }
            finally
            {
                //dispose of the worker thread pool
                worker.Dispose();
                if (reset)
                {
                    Reset();
                }
                worker = null;
            }
        }