???????е??????????
???????????? ???????[ 2012/4/13 11:03:14 ] ????????
??????????ò??е???????????е??????????????????????????????????Ч????????????????????????????????????????????????????????????λ?????TestRunner??
var executorWrapper=newExcetorWrapper(assemblyName??null??false);
var testRunner=newTestRunner(executorWrapper??newRunnerLoggerWrapper());
testRunner.RunAssembly();
???е?RunnerLoggerWrapper??????????????????Xunit??IRunnerLogger??XUnit????ò?????????????????????????
?????????????λ?????????????????????????????????????е???????????????У???????????????????г????в??????????????д????????????
privatestaticManualResetEvent[] resetEvents;
privatestaticQueue
privatestaticreadonlyObject LockAssembly2Queue=newObject();
publicvoidRun()
{
for(var index=0; index
{
resetEvents[index]=newManualResetEvent(false);
ThreadPool.QueueUserWorkItem(DoWork?? index);
}
WaitForAllManualEvent();
}
privatevoidWaitForAllManualEvent()
{
if(Thread.CurrentThread.ApartmentState=ApartmentState.STA)
{
foreach(var manualResetEventinresetEvents)
{
WaitHandle.WaitAny(newWaitHandle[]{manualResetEvent});
}
}
else
{
WaitHandle.WaitAll(resetEvents);
}
}
privatestaticvoidDoWork(Object index)
{
Thread.CurrentThread.ApartmentState=ApartmentState.STA;
while(true)
{
stringcurrentAssemblyName=null;
lock(LockAssembly2Queue)
{
if(assemblyQue.Count!=0)
{
currentAssemblyName=assemblyQue.Dequeue();
}
else
{
resetEvents[(int)index].Set();
Console.WriteLine("Exited current thread:{0}"?? Thread.CurrentThread.Name);
break;
}
}
if(currentAssemblyName!=null)
{
newTestRunnerWrapperWithAssembly(currentAssemblyName).Runner();
}
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11