private void OnSeqRun() { for (int i = stopIndex; i < Count; i++) { if (IsRun) { try { this[i].Single(); System.Diagnostics.Debug.WriteLine("testing " + i); } catch (Exception exp) { this[i].CleanUp(); ExceptionCollection.Add(exp); IsRun = IsRunWhenException; } if (ProgressReporter != null) { ProgressReporter.Invoke(i); } } else { stopIndex = i; System.Diagnostics.Debug.WriteLine(stopIndex); break; } } if (SeqFinish != null) { SeqFinish.Invoke(); IsRuning = false; } }
private void OnSeqRun() { var testStepList = ManualConnectionList[currentConnIndex].TestStepList; for (int i = stopIndex; i < testStepList.Count; i++) { if (IsRun) { if (testStepList[i].IsTest) { try { if (StepStart != null) { StepStart.Invoke(i); } testStepList[i].DetailProgressReport = (traceIndex, markerIndex) => { if (PointFinish != null) { PointFinish.Invoke(i, traceIndex, markerIndex); } }; testStepList[i].RunState = () => GetRunState(); if (!GeneTestSetup.Instance.IsSimulated) { //set path config if (pathConfig == null) { DataUtils.LOGINFO.WriteLog(testStepList[i].DisplayName + " path is empty"); } else { string configName = testStepList[i].PathConfigName; if (string.IsNullOrWhiteSpace(configName)) { DataUtils.LOGINFO.WriteLog(testStepList[i].DisplayName + " path is empty"); } else { var config = testStepList[i].GetPathConfigInfo(configName); if (config != null) { string configValue = config.Path; string[] pathConfigList = pathConfig.GetPathConfigNameList(); if (pathConfigList != null && pathConfigList.Contains(configValue)) { pathConfig.SetPathConfig(configValue); } else { DataUtils.LOGINFO.WriteLog(testStepList[i].DisplayName + " " + configValue + " path is not found"); throw (new Exception(testStepList[i].DisplayName + " " + configValue + " path is not found")); } } } } } DataUtils.LOGINFO.WriteLog(DateTime.Now.ToString() + testStepList[i].DisplayName + " single start"); testStepList[i].Single(); DataUtils.LOGINFO.WriteLog(DateTime.Now.ToString() + testStepList[i].DisplayName + " single finish"); if (!GeneTestSetup.Instance.IsSimulated) { if (pathConfig == null) { DataUtils.LOGINFO.WriteLog(testStepList[i].DisplayName + " path is empty"); } else { string configName = testStepList[i].PathConfigName; if (string.IsNullOrWhiteSpace(configName)) { DataUtils.LOGINFO.WriteLog(testStepList[i].DisplayName + " path is empty"); } else { var config = testStepList[i].GetPathConfigInfo(configName); if (config != null) { string configValue = config.Path; string[] pathConfigList = pathConfig.GetPathConfigNameList(); if (pathConfigList != null && pathConfigList.Contains(configValue)) { pathConfig.PostPathConfig(configValue); } else { DataUtils.LOGINFO.WriteLog(testStepList[i].DisplayName + " " + configValue + " path is not found"); throw (new Exception(testStepList[i].DisplayName + " " + configValue + " path is not found")); } } } } } testStepList[i].CalcStepInfo(); //更新连接步骤中的passfail ManualConnectionList[currentConnIndex].PassFail = Symtant.GeneFunLib.GeneFun.NullBoolAndList(testStepList.Select(x => x.PassFail).ToList()); if (StepFinish != null) { StepFinish.Invoke(i); } } catch (Exception exp) { testStepList[i].CleanUp(); ExceptionCollection.Add(exp); IsRun = IsRunWhenException; } } } else { stopIndex = i; System.Diagnostics.Debug.WriteLine(stopIndex); break; } } if (DXSplashScreen.IsActive) { DXSplashScreen.Close(); } IsRuning = false; if (SeqFinish != null) { SeqFinish.Invoke(); } }