From b6dd7cebe2728cac72d7a382313fbe3f22570f66 Mon Sep 17 00:00:00 2001 From: "Kevin Ransom (msft)" Date: Thu, 19 Nov 2020 14:20:34 -0800 Subject: [PATCH] temp (#10506) --- tests/FSharp.Test.Utilities/CompilerAssert.fs | 4 +++- tests/fsharp/single-test.fs | 12 ++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/FSharp.Test.Utilities/CompilerAssert.fs b/tests/FSharp.Test.Utilities/CompilerAssert.fs index 3e6f721379b..c163edb7617 100644 --- a/tests/FSharp.Test.Utilities/CompilerAssert.fs +++ b/tests/FSharp.Test.Utilities/CompilerAssert.fs @@ -137,7 +137,9 @@ let main argv = 0""" let mutable output = "" let mutable errors = "" let mutable cleanUp = true - let pathToTemp = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "../../../../Temp")) + let pathToArtifacts = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "../../../..")) + if Path.GetFileName(pathToArtifacts) <> "artifacts" then failwith "CompilerAssert did not find artifacts directory --- has the location changed????" + let pathToTemp = Path.Combine(pathToArtifacts, "Temp") let projectDirectory = Path.Combine(pathToTemp, "CompilerAssert", Path.GetRandomFileName()) let pathToFSharpCore = typeof.Assembly.Location try diff --git a/tests/fsharp/single-test.fs b/tests/fsharp/single-test.fs index f49281339ba..c12080d761e 100644 --- a/tests/fsharp/single-test.fs +++ b/tests/fsharp/single-test.fs @@ -3,6 +3,7 @@ open System open System.IO open System.Diagnostics +open System.Reflection open NUnit.Framework open TestFramework open HandleExpects @@ -222,12 +223,15 @@ let singleTestBuildAndRunCore cfg copyFiles p languageVersion = let mutable result = "" lock lockObj <| (fun () -> let rec loop () = - let dir = Path.Combine(Path.GetTempPath(), "FSharp.Cambridge", Path.GetRandomFileName()) - if Directory.Exists(dir) then + let pathToArtifacts = Path.GetFullPath(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "../../../..")) + if Path.GetFileName(pathToArtifacts) <> "artifacts" then failwith "FSharp.Cambridge did not find artifacts directory --- has the location changed????" + let pathToTemp = Path.Combine(pathToArtifacts, "Temp") + let projectDirectory = Path.Combine(pathToTemp, "FSharp.Cambridge", Path.GetRandomFileName()) + if Directory.Exists(projectDirectory) then loop () else - Directory.CreateDirectory(dir) |>ignore - dir + Directory.CreateDirectory(projectDirectory) |>ignore + projectDirectory result <- loop()) result