Skip to content

Commit

Permalink
temp (#10506)
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinRansom committed Nov 19, 2020
1 parent 52c6e6d commit 7036c05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
4 changes: 3 additions & 1 deletion tests/FSharp.Test.Utilities/CompilerAssert.fs
Expand Up @@ -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<RequireQualifiedAccessAttribute>.Assembly.Location
try
Expand Down
12 changes: 8 additions & 4 deletions tests/fsharp/single-test.fs
Expand Up @@ -3,6 +3,7 @@
open System
open System.IO
open System.Diagnostics
open System.Reflection
open NUnit.Framework
open TestFramework
open HandleExpects
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 7036c05

Please sign in to comment.