public static void Main(string[] args) { NUnitRunner runner = new NUnitRunner(args); if (runner.HasCustomArg("--no-shared-gvfs-cache")) { Console.WriteLine("Running without a shared git object cache"); GVFSTestConfig.NoSharedCache = true; } GVFSTestConfig.LocalCacheRoot = runner.GetCustomArgWithParam("--shared-gvfs-cache-root"); if (runner.HasCustomArg("--full-suite")) { Console.WriteLine("Running the full suite of tests"); GVFSTestConfig.UseAllRunners = true; } GVFSTestConfig.RepoToClone = runner.GetCustomArgWithParam("--repo-to-clone") ?? Properties.Settings.Default.RepoToClone; string servicePath = Path.Combine(TestContext.CurrentContext.TestDirectory, Properties.Settings.Default.PathToGVFSService); GVFSServiceProcess.InstallService(servicePath); try { Environment.ExitCode = runner.RunTests(Properties.Settings.Default.TestRepeatCount); } finally { string serviceLogFolder = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "GVFS", GVFSServiceProcess.TestServiceName, "Logs"); Console.WriteLine("GVFS.Service logs at '{0}' attached below.\n\n", serviceLogFolder); foreach (string filename in TestResultsHelper.GetAllFilesInDirectory(serviceLogFolder)) { TestResultsHelper.OutputFileContents(filename); } GVFSServiceProcess.UninstallService(); } if (Debugger.IsAttached) { Console.WriteLine("Tests completed. Press Enter to exit."); Console.ReadLine(); } }
public static void Main(string[] args) { NUnitRunner runner = new NUnitRunner(args); if (runner.HasCustomArg("--full-suite")) { Console.WriteLine("Running the full suite of tests"); FileSystemRunners.FileSystemRunner.UseAllRunners = true; } if (!runner.HasCustomArg("--run-builds")) { runner.ExcludeCategory(CategoryConstants.Build); } string servicePath = Path.Combine(TestContext.CurrentContext.TestDirectory, Properties.Settings.Default.PathToGVFSService); GVFSServiceProcess.InstallService(servicePath); try { Environment.ExitCode = runner.RunTests(Properties.Settings.Default.TestRepeatCount); } finally { string serviceLogFolder = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "GVFS", GVFSServiceProcess.TestServiceName, "Logs"); Console.WriteLine("GVFS.Service logs at '{0}' attached below.\n\n", serviceLogFolder); foreach (string filename in TestResultsHelper.GetAllFilesInDirectory(serviceLogFolder)) { TestResultsHelper.OutputFileContents(filename); } GVFSServiceProcess.UninstallService(); } if (Debugger.IsAttached) { Console.WriteLine("Tests completed. Press Enter to exit."); Console.ReadLine(); } }
private static void RunAfterAllTests() { if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { string serviceLogFolder = Path.Combine( Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "GVFS", GVFSServiceProcess.TestServiceName, "Logs"); Console.WriteLine("GVFS.Service logs at '{0}' attached below.\n\n", serviceLogFolder); foreach (string filename in TestResultsHelper.GetAllFilesInDirectory(serviceLogFolder)) { TestResultsHelper.OutputFileContents(filename); } GVFSServiceProcess.UninstallService(); } PrintTestCaseStats.PrintRunTimeStats(); }