public void Run() { testInstance.Init(); lock (isStartLock) { if (!isStart) { isStart = true; } else { CompleteEvent(this); return; } } //告知客户端测试用例数量 this.tcpMessageContext.SendEvent("SetTestCauseCount", new string[] { testInstance.TestCases.Count().ToString() }); //告知客户端需要测试的平台数量 this.tcpMessageContext.SendEvent("SetPlatformCount", new string[] { testInstance.Platforms.Count().ToString() }); //根据用户选择的平台每个平台都测试 foreach (var item in testInstance.Platforms) { this.nowDriver = item; //开始每个测试用例 foreach (var testCase in testInstance.TestCases) { lock (isStartLock) { if (!isStart) { CompleteEvent(this); return; } } RunTestCase(testCase); } } CompleteEvent(this); }