Skip to content
Closed
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"projects": [ "src/fsharp", "tests" ]
"projects": [ "src/fsharp", "tests" ],
"sdk": {
"version": "1.0.0-preview2-003131"
}
}
25 changes: 24 additions & 1 deletion tests/service/ProjectAnalysisTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4505,10 +4505,16 @@ module Project35b =
open System.IO

let fileName1 = Path.ChangeExtension(Path.GetTempFileName(), ".fsx")
#if DOTNETCORE
let fileSource1 = """
#r "System.Private.CoreLib.dll"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ... this is fine for a test but not as a long term solution. We will have a decent solution for this eventually.

A preferable approach for tests would be to use:
https://github.com/Microsoft/visualfsharp/blob/master/tests/scripts/fsci.fsx
with a project.json file identifying dependencies.

Kevin

Copy link
Contributor Author

@ncave ncave Feb 17, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KevinRansom
For checker.GetProjectOptionsFromScript, is there a duplication of responsibility between assumeDotNetFramework=false and otherFlags = [| "--targetprofile:netcore" |] ?

#r "notexist.dll"
"""
#else
let fileSource1 = """
#r "System.dll"
#r "notexist.dll"
"""
#endif
File.WriteAllText(fileName1, fileSource1)
let cleanFileName a = if a = fileName1 then "file1" else "??"

Expand All @@ -4523,6 +4529,23 @@ module Project35b =
let options = checker.GetProjectOptionsFromScript(fileName1, fileSource1) |> Async.RunSynchronously
#endif

[<Test>]
let ``Test Project35b whole project errors`` () =
#if DOTNETCORE
let options = checker.GetProjectOptionsFromScript(Project35b.fileName1, Project35b.fileSource1, assumeDotNetFramework=false) |> Async.RunSynchronously
#else
let options = checker.GetProjectOptionsFromScript(Project35b.fileName1, Project35b.fileSource1) |> Async.RunSynchronously
#endif
let wholeProjectResults = checker.ParseAndCheckProject(options) |> Async.RunSynchronously
for e in wholeProjectResults.Errors do
printfn "Project35b error: <<<%s>>>" e.Message
wholeProjectResults.Errors.Length
#if DOTNETCORE
|> shouldEqual 1
#else
|> shouldEqual 2
#endif

[<Test>]
let ``Test project35b Dependency files for ParseAndCheckFileInProject`` () =
let checkFileResults =
Expand Down