public void RunAssemblyTests(string assemblyFile, string testName) { string assemblyFileName = Path.GetFileName(assemblyFile); string xmlResult = XmlFileNamer.GetResultsDirectory(Script) + Path.DirectorySeparatorChar + Path.GetFileNameWithoutExtension(assemblyFileName).Replace(".", "-") + ".xml"; if (!Directory.Exists(Path.GetDirectoryName(xmlResult))) { Directory.CreateDirectory(Path.GetDirectoryName(xmlResult)); } string command = "mono"; List <string> arguments = new List <string>(); // TODO: Remove if not needed arguments.Add("--runtime=v4.0"); // TODO: Make configurable arguments.Add("lib/NUnit.Runners.2.6.0.12051/tools/nunit-console.exe"); arguments.Add("\"" + PathConverter.ToRelative(assemblyFile) + "\""); arguments.Add("-xml=" + PathConverter.ToRelative(xmlResult)); if (!String.IsNullOrEmpty(testName)) { arguments.Add("-run=" + testName); } if (IncludeCategories != null && IncludeCategories.Length > 0) { arguments.Add("-include=" + String.Join(",", IncludeCategories)); } if (ExcludeCategories != null && ExcludeCategories.Length > 0) { arguments.Add("-exclude=" + String.Join(",", ExcludeCategories)); } Script.StartProcess( command, arguments.ToArray() ); }
public void EnsureDirectories() { var xmlResultDir = XmlFileNamer.GetResultsDirectory(Script); if (!Directory.Exists(xmlResultDir)) { Directory.CreateDirectory(xmlResultDir); } var htmlResultDir = HtmlFileNamer.GetResultsDirectory(Script); if (!Directory.Exists(htmlResultDir)) { Directory.CreateDirectory(htmlResultDir); } }
public void GenerateResults() { var xmlResultDir = XmlFileNamer.GetResultsDirectory(Script) + Path.DirectorySeparatorChar; string htmlResultDir = HtmlFileNamer.GetResultsDirectory(Script); List <string> arguments = new List <string> (); arguments.Add("lib/NUnitResults.1.1/bin/nunit-results.exe"); arguments.Add("\"" + xmlResultDir + "\""); arguments.Add("\"" + htmlResultDir + "\""); Script.StartProcess( "mono", arguments.ToArray() ); }