diff --git a/tests/FSharp.Test.Utilities/TestFramework.fs b/tests/FSharp.Test.Utilities/TestFramework.fs index a27a140c98..012ca3b895 100644 --- a/tests/FSharp.Test.Utilities/TestFramework.fs +++ b/tests/FSharp.Test.Utilities/TestFramework.fs @@ -5,6 +5,7 @@ module TestFramework open Microsoft.Win32 open System open System.IO +open System.Reflection open System.Text.RegularExpressions open System.Diagnostics open Scripting @@ -55,8 +56,17 @@ module Commands = else p.WaitForExit() #if DEBUG - File.WriteAllLines(Path.Combine(workingDir, "StandardOutput.txt"), outputList) - File.WriteAllLines(Path.Combine(workingDir, "StandardError.txt"), errorsList) + let workingDir' = + if workingDir = "" + then + // Assign working dir to prevent default to C:\Windows\System32 + let executionLocation = Assembly.GetExecutingAssembly().Location + Path.GetDirectoryName executionLocation + else + workingDir + + File.WriteAllLines(Path.Combine(workingDir', "StandardOutput.txt"), outputList) + File.WriteAllLines(Path.Combine(workingDir', "StandardError.txt"), errorsList) #endif p.ExitCode, outputList.ToArray(), errorsList.ToArray() | None -> -1, Array.empty, Array.empty