internal int ExecuteValidCommandLine(CmdLineHandler clh, IRecipe recipe) { var result = 0; SetUpCategorySelector("testCategory", clh, recipe); SetUpCategorySelector("fixtureCategory", clh, recipe); SetUpRegexSelector(clh, recipe); DefaultXmlWriter resultWriter = null; if (clh.HasOption("xml")) { var resultPathName = clh.GetOptionValueFor("xml"); resultPathName = resultPathName == string.Empty ? "csUnit.results.xml" : resultPathName; resultWriter = new DefaultXmlWriter(recipe, resultPathName); } recipe.Aborted += RecipeAborted; recipe.RunTests(new TestRun(new AllTestsCriterion())); recipe.Join(); if (resultWriter != null) { resultWriter.Save(); result = resultWriter.Result; } if (result == 0 && _recipeAborted) { Console.Error.WriteLine("Tests Aborted: " + _recipeAbortMessage); result = 2; } return(result); }
internal int ExecuteValidCommandLine(CmdLineHandler clh, IRecipe recipe) { var result = 0; SetUpCategorySelector("testCategory", clh, recipe); SetUpCategorySelector("fixtureCategory", clh, recipe); SetUpRegexSelector(clh, recipe); DefaultXmlWriter resultWriter = null; if(clh.HasOption("xml")) { var resultPathName = clh.GetOptionValueFor("xml"); resultPathName = resultPathName == string.Empty ? "csUnit.results.xml" : resultPathName; resultWriter = new DefaultXmlWriter(recipe, resultPathName); } recipe.Aborted += RecipeAborted; recipe.RunTests(new TestRun(new AllTestsCriterion())); recipe.Join(); if(resultWriter != null) { resultWriter.Save(); result = resultWriter.Result; } if (result == 0 && _recipeAborted) { Console.Error.WriteLine("Tests Aborted: " + _recipeAbortMessage); result = 2; } return result; }