forked from dotnet/fsharp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ec476d
commit fd67ddb
Showing
10 changed files
with
218 additions
and
439 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
module FSharp.Compiler.Service.Tests2.RunCompiler | ||
|
||
open System | ||
open System.Collections.Concurrent | ||
open System.Collections.Generic | ||
open System.Threading | ||
open System.Threading.Tasks | ||
open FSharp.Compiler.Service.Tests | ||
open FSharp.Compiler.Service.Tests.Graph | ||
open NUnit.Framework | ||
|
||
[<Test>] | ||
let runCompiler () = | ||
let args = | ||
System.IO.File.ReadAllLines(@"C:\projekty\fsharp\heuristic\tests\FSharp.Compiler.Service.Tests2\args.txt") |> Array.skip 1 | ||
FSharp.Compiler.CommandLineMain.main args |> ignore | ||
|
||
[<Test>] | ||
let runGrapher () = | ||
// let args = | ||
// System.IO.File.ReadAllLines(@"C:\projekty\fsharp\heuristic\tests\FSharp.Compiler.Service.Tests2\args.txt") |> Array.skip 1 | ||
// FSharp.Compiler.CommandLineMain.main args |> ignore | ||
|
||
let deps : Graph<int> = | ||
[| | ||
0, [||] // A | ||
1, [|0|] // B1 -> A | ||
2, [|1|] // B2 -> B1 | ||
3, [|0|] // C1 -> A | ||
4, [|3|] // C2 -> C1 | ||
5, [|2; 4|] // D -> B2, C2 | ||
|] | ||
|> readOnlyDict | ||
|
||
let dependants = deps |> Graph.reverse | ||
let transitiveDeps = deps |> Graph.transitive | ||
let transitiveDependants = transitiveDeps |> Graph.reverse | ||
|
||
let nodes = | ||
deps.Keys | ||
|> Seq.map (fun idx -> idx, {Idx = idx; Deps = [||]; Dependants = [||]; TransitiveDeps = [||]; Result = None; UnprocessedDepsCount = 0; _lock = Object()}) | ||
|> readOnlyDict | ||
|
||
let processs deps = deps |> Array.map (fun d -> nodes[d]) | ||
|
||
let graph = | ||
nodes | ||
|> Seq.iter (fun (KeyValue(idx, node)) -> | ||
node.Deps <- processs deps[idx] | ||
node.TransitiveDeps <- processs transitiveDeps[idx] | ||
node.Dependants <- processs dependants[idx] | ||
node.UnprocessedDepsCount <- node.Deps.Length | ||
) | ||
nodes.Values | ||
|> Seq.toArray | ||
|
||
GraphProcessing.processGraph graph |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.