Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests: clean-up unneeded code #17762

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions tests/fsharp/single-test.fs
Original file line number Diff line number Diff line change
Expand Up @@ -226,21 +226,7 @@ let singleTestBuildAndRunCore cfg copyFiles p languageVersion =
// optimize = true or false
let executeSingleTestBuildAndRun outputType compilerType targetFramework optimize buildOnly =
let mutable result = false
let directory =
let mutable result = ""
lock lockObj <| (fun () ->
let rec loop () =
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", Guid.NewGuid().ToString() + ".tmp")
if Directory.Exists(projectDirectory) then
loop ()
else
Directory.CreateDirectory(projectDirectory) |>ignore
projectDirectory
result <- loop())
result
let directory = cfg.Directory

let pc = {
OutputType = outputType
Expand Down Expand Up @@ -270,10 +256,6 @@ let singleTestBuildAndRunCore cfg copyFiles p languageVersion =
let overridesFileName = Path.Combine(directory, "Directory.Overrides.targets")
let projectFileName = Path.Combine(directory, Guid.NewGuid().ToString() + ".tmp" + ".fsproj")
try
// Clean up directory
Directory.CreateDirectory(directory) |> ignore
copyFilesToDest cfg.Directory directory
try File.Delete(Path.Combine(directory, "FSharp.Core.dll")) with _ -> ()
emitFile targetsFileName targetsBody
emitFile overridesFileName overridesBody
let buildOutputFile = Path.Combine(directory, "buildoutput.txt")
Expand Down Expand Up @@ -304,9 +286,7 @@ let singleTestBuildAndRunCore cfg copyFiles p languageVersion =
executeFsi compilerType targetFramework
result <- true
finally
if result <> false then
try Directory.Delete(directory, true) with _ -> ()
else
if result = true then
printfn "Configuration: %s" cfg.Directory
printfn "Directory: %s" directory
printfn "Filename: %s" projectFileName
Expand Down
Loading