public override tagVARIATION_STATUS Execute() { List <object> children = Children; if (children != null && children.Count > 0) { // this is not a leaf node, just invoke all the children's execute foreach (object child in children) { CTestCase childTc = child as CTestCase; if (childTc != null) //nested test test case class will be child of a test case { childTc.Init(); childTc.Execute(); continue; } CVariation var = child as CVariation; if (var != null && CModInfo.IsVariationSelected(var.Desc)) { const string indent = "\t"; try { CurVariation = var; tagVARIATION_STATUS ret = var.Execute(); if (tagVARIATION_STATUS.eVariationStatusPassed == ret) { TestModule.PassCount++; } else if (tagVARIATION_STATUS.eVariationStatusFailed == ret) { System.Console.WriteLine(indent + var.Desc); System.Console.WriteLine(indent + " FAILED"); TestModule.FailCount++; } else { System.Console.WriteLine(indent + var.Desc); System.Console.WriteLine(indent + " SKIPPED"); TestModule.SkipCount++; } } catch (CTestSkippedException tse) { System.Console.WriteLine(indent + var.Desc); System.Console.WriteLine(indent + " SKIPPED" + ", Msg:" + tse.Message); TestModule.SkipCount++; } catch (Exception e) { System.Console.WriteLine(indent + var.Desc); System.Console.WriteLine("unexpected exception happend:{0}", e.Message); System.Console.WriteLine(e.StackTrace); System.Console.WriteLine(indent + " FAILED"); TestModule.FailCount++; } } } } return(tagVARIATION_STATUS.eVariationStatusPassed); }
public override tagVARIATION_STATUS Execute() { List <object> children = Children; if (children != null && children.Count > 0) { // this is not a leaf node, just invoke all the children's execute foreach (object child in children) { CTestCase tc = child as CTestCase; if (tc != null) { if (CModInfo.IsTestCaseSelected(tc.Name)) { Console.WriteLine("TestCase:{0} - {1}", tc.Attribute.Name, tc.Attribute.Desc); tc.Init(); tc.Execute(); } } } } Console.WriteLine("Pass:{0}, Fail:{1}, Skip:{2}", PassCount, FailCount, SkipCount); return(tagVARIATION_STATUS.eVariationStatusPassed); }