コード例 #1
0
        /// <summary>
        /// Our ThreadProc, which pulls and runs tests in a loop
        /// </summary>
        void TestWorkerThreadProc()
        {
            log.Info("{0} starting ", _workerThread.Name);

            for (;;)
            {
                var workItem = _readyQueue.Dequeue();
                if (workItem == null)
                {
                    break;
                }

                log.Debug("{0} processing {1}", _workerThread.Name, workItem.Test.Name);

                if (Busy != null)
                {
                    Busy(this, EventArgs.Empty);
                }
                workItem.Execute();
                if (Idle != null)
                {
                    Idle(this, EventArgs.Empty);
                }

                ++_workItemCount;
            }

            log.Info("{0} stopping - {1} WorkItems processed.", _workerThread.Name, _workItemCount);
        }
コード例 #2
0
        /// <summary>
        /// Our ThreadProc, which pulls and runs tests in a loop
        /// </summary>
        void TestWorkerThreadProc()
        {
            for (;;)
            {
                var workItem = _readyQueue.Dequeue();
                if (workItem == null)
                {
                    break;
                }

                log.Debug("Processing WorkItem for {0}", workItem.Test.FullName);
                workItem.Execute();
                ++_workItemCount;
            }

            log.Info("Stopping - {0} WorkItems processed.", _workItemCount);
        }
コード例 #3
0
ファイル: TestWorker.cs プロジェクト: winniewwong/nunit
        private void TestWorkerThreadProc()
        {
            log.Info("{0} starting ", _workerThread.Name);

            _running = true;

            try
            {
                while (_running)
                {
                    _currentWorkItem = _readyQueue.Dequeue();
                    if (_currentWorkItem == null)
                    {
                        break;
                    }

                    log.Info("{0} executing {1}", _workerThread.Name, _currentWorkItem.Test.Name);

                    if (Busy != null)
                    {
                        Busy(this, EventArgs.Empty);
                    }

                    _currentWorkItem.WorkerId = Name;
                    _currentWorkItem.Execute();

                    if (Idle != null)
                    {
                        Idle(this, EventArgs.Empty);
                    }

                    ++_workItemCount;
                }
            }
            finally
            {
                log.Info("{0} stopping - {1} WorkItems processed.", _workerThread.Name, _workItemCount);
            }
        }
コード例 #4
0
ファイル: WorkItemQueueTests.cs プロジェクト: jnm2/nunit
 private void VerifyQueueContents()
 {
     Assert.That(_queue.Dequeue().Test.Name, Is.EqualTo("Test1"));
     Assert.That(_queue.Dequeue().Test.Name, Is.EqualTo("Test2"));
     Assert.That(_queue.Dequeue().Test.Name, Is.EqualTo("Test3"));
 }