Skip to content

Commit

Permalink
Remove hardcoded local examples.
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Nov 29, 2022
1 parent 48e4194 commit 1cf73f2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 449 deletions.
28 changes: 13 additions & 15 deletions tests/ParallelTypeCheckingTests/Code/ParallelTypeChecking.fs
Original file line number Diff line number Diff line change
Expand Up @@ -54,19 +54,19 @@ let CheckMultipleInputsInParallel
})

let graph = DependencyResolution.mkGraph sourceFiles
graph |> Graph.map (fun idx -> sourceFiles.[idx].File) |> Graph.print

let graphDumpPath =
let graphDumpName =
tcConfig.outputFile
|> Option.map Path.GetFileName
|> Option.defaultValue "project"

$"{graphDumpName}.deps.json"

graph
|> Graph.map (fun idx -> sourceFiles.[idx].File)
|> Graph.serialiseToJson graphDumpPath
// graph |> Graph.map (fun idx -> sourceFiles.[idx].File) |> Graph.print

// let graphDumpPath =
// let graphDumpName =
// tcConfig.outputFile
// |> Option.map Path.GetFileName
// |> Option.defaultValue "project"
//
// $"{graphDumpName}.deps.json"
//
// graph
// |> Graph.map (fun idx -> sourceFiles.[idx].File)
// |> Graph.serialiseToJson graphDumpPath

let _ = ctok // TODO Use
let diagnosticsLogger = DiagnosticsThreadStatics.DiagnosticsLogger
Expand Down Expand Up @@ -109,8 +109,6 @@ let CheckMultipleInputsInParallel
// printfn $"Finished Processing AST {file.ToString()}"
return
(fun (isFinalFold: bool) (state: State) ->
if isFinalFold then
printfn "final fold for %s" input.FileName

// printfn $"Applying {file.ToString()}"
let tcState, priorErrors = state
Expand Down
40 changes: 0 additions & 40 deletions tests/ParallelTypeCheckingTests/Code/TrieMapping.fs
Original file line number Diff line number Diff line change
Expand Up @@ -232,43 +232,3 @@ and mkTrieForNestedSigModule (fileIndex: int) (decl: SynModuleSigDecl) : KeyValu

let mkTrie (files: FileWithAST array) : TrieNode =
mergeTrieNodes 0 (Array.Parallel.map mkTrieNodeFor files)

// ==================================================================================================================================================
// ==================================================================================================================================================
open FSharp.Compiler.Service.Tests.Common
open NUnit.Framework

[<Test>]
let ``Fantomas Core trie`` () =
let files =
[|
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\obj\Debug\netstandard2.0\.NETStandard,Version=v2.0.AssemblyAttributes.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\obj\Debug\netstandard2.0\Fantomas.Core.AssemblyInfo.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\AssemblyInfo.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\ISourceTextExtensions.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\RangeHelpers.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\AstExtensions.fsi"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\TriviaTypes.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\Utils.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\SourceParser.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\AstTransformer.fsi"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\Version.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\Queue.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\FormatConfig.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\Defines.fsi"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\Trivia.fsi"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\Trivia.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\SourceTransformer.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\Context.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\CodePrinter.fsi"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\CodeFormatterImpl.fsi"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\Validation.fs"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\Selection.fsi"
@"C:\Users\nojaf\Projects\main-fantomas\src\Fantomas.Core\CodeFormatter.fsi"
|]
|> Array.mapi (fun idx file ->
let ast = parseSourceCode (file, System.IO.File.ReadAllText(file))
{ Idx = idx; File = file; AST = ast })

let trie = mkTrie files
ignore trie
15 changes: 1 addition & 14 deletions tests/ParallelTypeCheckingTests/Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,6 @@ open ParallelTypeCheckingTests.TestUtils
// Method = mode
// WorkingDir = workingDir
// }
open ParallelTypeCheckingTests
open ParallelTypeCheckingTests.DependencyResolution

[<EntryPoint>]
let main _argv =
let filesWithAST =
ParallelTypeCheckingTests.Tests.DependencyResolutionTests.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
let main _argv = 0

0 comments on commit 1cf73f2

Please sign in to comment.