diff --git a/Benchmark/PerformanceTest.cs b/Benchmark/PerformanceTest.cs index 3b455ba0..a10571c6 100644 --- a/Benchmark/PerformanceTest.cs +++ b/Benchmark/PerformanceTest.cs @@ -50,6 +50,8 @@ public static void Test(string dataDir, string resultsFilename, string version, foreach (var syntheticRep in syntheticReps) File.Delete(syntheticRep); + if (verInfo.OutputDir != null) + Directory.Delete(verInfo.OutputDir, true); timer.Stop(); Console.WriteLine($"\r{msg}Done!\t(ET: {timer.Elapsed}"); diff --git a/Benchmark/VersionInfo.cs b/Benchmark/VersionInfo.cs index 0e30750f..f38df7a9 100644 --- a/Benchmark/VersionInfo.cs +++ b/Benchmark/VersionInfo.cs @@ -26,6 +26,8 @@ public ProcessStartInfo StartInfo public Uri ReleaseUri { private set; get; } + public string? OutputDir { private set; get; } = null; + public VersionInfo( string version, @@ -49,11 +51,12 @@ private bool TryRunVerSpecificConfig(string version) { _invocation = "mspc.exe"; ReleaseUri = new Uri(ReleaseUri, $"download/{version}/mspc.zip"); + SetOutputDir(); return true; } pattern = new Regex(@"^v2\.\d+(\.\d+)?$"); - if(pattern.IsMatch(version)) + if (pattern.IsMatch(version)) { _invocation = "mspc.exe"; ReleaseUri = new Uri(ReleaseUri, $"download/{version}/v2.1.zip"); @@ -83,5 +86,12 @@ private async Task<(bool, string)> TryLocalize() return (true, dir); } + + private void SetOutputDir() + { + OutputDir = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); + Directory.CreateDirectory(OutputDir); + Args += $" -o {Path.Combine(OutputDir, "tmp")}"; + } } }