Skip to content

Commit

Permalink
Hard coded test in entry point.
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Nov 23, 2022
1 parent 18ef04e commit 2d98905
Showing 1 changed file with 33 additions and 24 deletions.
57 changes: 33 additions & 24 deletions tests/ParallelTypeCheckingTests/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,40 @@
open FSharp.Compiler.CompilerConfig
open ParallelTypeCheckingTests.TestUtils

let _parse (argv: string[]) : Args =
let parseMode (mode: string) =
match mode.ToLower() with
| "sequential" -> Method.Sequential
| "parallelfs" -> Method.ParallelCheckingOfBackedImplFiles
| "graph" -> Method.Graph
| _ -> failwith $"Unrecognised mode: {mode}"

let path, mode, workingDir =
match argv with
| [| path |] -> path, Method.Sequential, None
| [| path; method |] -> path, parseMode method, None
| [| path; method; workingDir |] -> path, parseMode method, Some workingDir
| _ -> failwith "Invalid args - use 'args_path [method [fs-parallel]]'"

{
Path = path
LineLimit = None
Method = mode
WorkingDir = workingDir
}
// let _parse (argv: string[]) : Args =
// let parseMode (mode: string) =
// match mode.ToLower() with
// | "sequential" -> Method.Sequential
// | "parallelfs" -> Method.ParallelCheckingOfBackedImplFiles
// | "graph" -> Method.Graph
// | _ -> failwith $"Unrecognised mode: {mode}"
//
// let path, mode, workingDir =
// match argv with
// | [| path |] -> path, Method.Sequential, None
// | [| path; method |] -> path, parseMode method, None
// | [| path; method; workingDir |] -> path, parseMode method, Some workingDir
// | _ -> failwith "Invalid args - use 'args_path [method [fs-parallel]]'"
//
// {
// Path = path
// LineLimit = None
// Method = mode
// WorkingDir = workingDir
// }
open ParallelTypeCheckingTests.Code.TrieApproach
open ParallelTypeCheckingTests.Code.TrieApproach.DependencyResolution

[<EntryPoint>]
let main _argv =
let args = _parse _argv
let args = { args with LineLimit = None }
TestCompilationFromCmdlineArgs.TestCompilerFromArgs args
let filesWithAST =
fcsFiles
|> Array.Parallel.mapi (fun idx file ->
{
Idx = idx
AST = FSharp.Compiler.Service.Tests.Common.parseSourceCode (file, System.IO.File.ReadAllText(file))
File = file
})

let _graph = mkGraph filesWithAST
0

0 comments on commit 2d98905

Please sign in to comment.