Skip to content

Commit d3ec16c

Browse files
authored
Merge pull request #9358 from dotnet/merges/master-to-release/dev16.7
Merge master to release/dev16.7
2 parents 57e7c60 + aaeb058 commit d3ec16c

File tree

60 files changed

+1085
-961
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1085
-961
lines changed

FSharp.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsiAnyCpu", "src\fsharp\fsi
2424
{649FA588-F02E-457C-9FCF-87E46407481E} = {649FA588-F02E-457C-9FCF-87E46407481E}
2525
EndProjectSection
2626
EndProject
27+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.TestsHelpers", "tests\FSharp.TestHelpers\FSharp.TestHelpers.fsproj", "{60D275B0-B14A-41CB-A1B2-E815A7448FCB} "
28+
EndProject
2729
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharpSuite.Tests", "tests\fsharp\FSharpSuite.Tests.fsproj", "{C163E892-5BF7-4B59-AA99-B0E8079C67C4}"
2830
EndProject
2931
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.UnitTests", "tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj", "{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}"
@@ -156,6 +158,18 @@ Global
156158
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|Any CPU.Build.0 = Release|Any CPU
157159
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|x86.ActiveCfg = Release|Any CPU
158160
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B}.Release|x86.Build.0 = Release|Any CPU
161+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
162+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
163+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Debug|x86.ActiveCfg = Debug|Any CPU
164+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Debug|x86.Build.0 = Debug|Any CPU
165+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Proto|Any CPU.ActiveCfg = Release|Any CPU
166+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Proto|Any CPU.Build.0 = Release|Any CPU
167+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Proto|x86.ActiveCfg = Release|Any CPU
168+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Proto|x86.Build.0 = Release|Any CPU
169+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
170+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Release|Any CPU.Build.0 = Release|Any CPU
171+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Release|x86.ActiveCfg = Release|Any CPU
172+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Release|x86.Build.0 = Release|Any CPU
159173
{C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
160174
{C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
161175
{C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -276,6 +290,7 @@ Global
276290
{649FA588-F02E-457C-9FCF-87E46407481E} = {B8DDA694-7939-42E3-95E5-265C2217C142}
277291
{D0E98C0D-490B-4C61-9329-0862F6E87645} = {B8DDA694-7939-42E3-95E5-265C2217C142}
278292
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B} = {B8DDA694-7939-42E3-95E5-265C2217C142}
293+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
279294
{C163E892-5BF7-4B59-AA99-B0E8079C67C4} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
280295
{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
281296
{88E2D422-6852-46E3-A740-83E391DC7973} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}

VisualFSharp.sln

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsiAnyCpu", "src\fsharp\fsi
8686
EndProject
8787
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "fsi", "src\fsharp\fsi\fsi.fsproj", "{D0E98C0D-490B-4C61-9329-0862F6E87645}"
8888
EndProject
89+
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.TestsHelpers", "tests\FSharp.TestHelpers\FSharp.TestHelpers.fsproj", "{60D275B0-B14A-41CB-A1B2-E815A7448FCB} "
90+
EndProject
8991
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharpSuite.Tests", "tests\fsharp\FSharpSuite.Tests.fsproj", "{C163E892-5BF7-4B59-AA99-B0E8079C67C4}"
9092
EndProject
9193
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FSharp.Compiler.UnitTests", "tests\FSharp.Compiler.UnitTests\FSharp.Compiler.UnitTests.fsproj", "{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5}"
@@ -528,6 +530,18 @@ Global
528530
{D0E98C0D-490B-4C61-9329-0862F6E87645}.Release|Any CPU.Build.0 = Release|Any CPU
529531
{D0E98C0D-490B-4C61-9329-0862F6E87645}.Release|x86.ActiveCfg = Release|Any CPU
530532
{D0E98C0D-490B-4C61-9329-0862F6E87645}.Release|x86.Build.0 = Release|Any CPU
533+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
534+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Debug|Any CPU.Build.0 = Debug|Any CPU
535+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Debug|x86.ActiveCfg = Debug|Any CPU
536+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Debug|x86.Build.0 = Debug|Any CPU
537+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Proto|Any CPU.ActiveCfg = Release|Any CPU
538+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Proto|Any CPU.Build.0 = Release|Any CPU
539+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Proto|x86.ActiveCfg = Release|Any CPU
540+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Proto|x86.Build.0 = Release|Any CPU
541+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Release|Any CPU.ActiveCfg = Release|Any CPU
542+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Release|Any CPU.Build.0 = Release|Any CPU
543+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Release|x86.ActiveCfg = Release|Any CPU
544+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB}.Release|x86.Build.0 = Release|Any CPU
531545
{C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
532546
{C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|Any CPU.Build.0 = Debug|Any CPU
533547
{C163E892-5BF7-4B59-AA99-B0E8079C67C4}.Debug|x86.ActiveCfg = Debug|Any CPU
@@ -964,6 +978,7 @@ Global
964978
{649FA588-F02E-457C-9FCF-87E46407481E} = {B8DDA694-7939-42E3-95E5-265C2217C142}
965979
{8B3E283D-B5FE-4055-9D80-7E3A32F3967B} = {B8DDA694-7939-42E3-95E5-265C2217C142}
966980
{D0E98C0D-490B-4C61-9329-0862F6E87645} = {B8DDA694-7939-42E3-95E5-265C2217C142}
981+
{60D275B0-B14A-41CB-A1B2-E815A7448FCB} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
967982
{C163E892-5BF7-4B59-AA99-B0E8079C67C4} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
968983
{A8D9641A-9170-4CF4-8FE0-6DB8C134E1B5} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}
969984
{88E2D422-6852-46E3-A740-83E391DC7973} = {CFE3259A-2D30-4EB0-80D5-E8B5F3D01449}

tests/fsharp/Compiler/CompilerAssert.fs renamed to tests/FSharp.TestHelpers/CompilerAssert.fs

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
22

3-
[<AutoOpen>]
4-
module FSharp.Compiler.UnitTests.CompilerAssert
3+
namespace FSharp.TestHelpers
54

65
open System
76
open System.Diagnostics
@@ -20,7 +19,7 @@ open NUnit.Framework
2019
open System.Reflection.Emit
2120
open Microsoft.CodeAnalysis
2221
open Microsoft.CodeAnalysis.CSharp
23-
open FSharp.Compiler.UnitTests.Utilities
22+
open FSharp.TestHelpers.Utilities
2423

2524
[<Sealed>]
2625
type ILVerifier (dllFilePath: string) =
@@ -56,8 +55,8 @@ type CompileOutput =
5655
| Library
5756
| Exe
5857

59-
type CompilationReference =
60-
private
58+
type CompilationReference =
59+
private
6160
| CompilationReference of Compilation * staticLink: bool
6261
| TestCompilationReference of TestCompilation
6362

@@ -254,11 +253,11 @@ let main argv = 0"""
254253
|> Array.map (fun info ->
255254
(info.Severity, info.ErrorNumber, (info.StartLineAlternate - libAdjust, info.StartColumn + 1, info.EndLineAlternate - libAdjust, info.EndColumn + 1), info.Message))
256255

257-
let checkEqual k a b =
258-
if a <> b then
256+
let checkEqual k a b =
257+
if a <> b then
259258
Assert.AreEqual(a, b, sprintf "Mismatch in %s, expected '%A', got '%A'.\nAll errors:\n%A" k a b errors)
260259

261-
checkEqual "Errors" (Array.length expectedErrors) errors.Length
260+
checkEqual "Errors" (Array.length expectedErrors) errors.Length
262261

263262
Array.zip errors expectedErrors
264263
|> Array.iter (fun (actualError, expectedError) ->
@@ -278,16 +277,16 @@ let main argv = 0"""
278277
let compilationRefs, deps =
279278
match cmpl with
280279
| Compilation(_, _, _, _, cmpls, _) ->
281-
let compiledRefs =
280+
let compiledRefs =
282281
cmpls
283282
|> List.map (fun cmpl ->
284283
match cmpl with
285284
| CompilationReference (cmpl, staticLink) ->
286285
compileCompilationAux outputPath disposals ignoreWarnings cmpl, staticLink
287-
| TestCompilationReference (cmpl) ->
286+
| TestCompilationReference (cmpl) ->
288287
let tmp = Path.Combine(outputPath, Path.ChangeExtension(Path.GetRandomFileName(), ".dll"))
289-
disposals.Add({ new IDisposable with
290-
member _.Dispose() =
288+
disposals.Add({ new IDisposable with
289+
member _.Dispose() =
291290
try File.Delete tmp with | _ -> () })
292291
cmpl.EmitAsFile tmp
293292
(([||], tmp), []), false)
@@ -330,14 +329,14 @@ let main argv = 0"""
330329
match cmpl with
331330
| Compilation(source, _, _, _, _, _) -> source
332331

333-
let options =
332+
let options =
334333
match cmpl with
335334
| Compilation(_, _, _, options, _, _) -> options
336335

337336
let nameOpt =
338337
match cmpl with
339338
| Compilation(_, _, _, _, _, nameOpt) -> nameOpt
340-
339+
341340
let disposal, res = compileDisposable outputPath isScript isExe (Array.append options compilationRefs) nameOpt source
342341
disposals.Add disposal
343342

@@ -362,7 +361,7 @@ let main argv = 0"""
362361

363362
static member CompileWithErrors(cmpl: Compilation, expectedErrors, ?ignoreWarnings) =
364363
let ignoreWarnings = defaultArg ignoreWarnings false
365-
lock gate (fun () ->
364+
lock gate (fun () ->
366365
compileCompilation ignoreWarnings cmpl (fun ((errors, _), _) ->
367366
assertErrors 0 ignoreWarnings errors expectedErrors))
368367

@@ -374,7 +373,7 @@ let main argv = 0"""
374373
let beforeExecute = defaultArg beforeExecute (fun _ _ -> ())
375374
let newProcess = defaultArg newProcess false
376375
let onOutput = defaultArg onOutput (fun _ -> ())
377-
lock gate (fun () ->
376+
lock gate (fun () ->
378377
compileCompilation ignoreWarnings cmpl (fun ((errors, outputFilePath), deps) ->
379378
assertErrors 0 ignoreWarnings errors [||]
380379
beforeExecute outputFilePath deps
@@ -447,9 +446,9 @@ let main argv = 0"""
447446

448447
Assert.IsEmpty(typeCheckResults.Errors, sprintf "Type Check errors: %A" typeCheckResults.Errors)
449448

450-
static member TypeCheckWithErrorsAndOptionsAgainstBaseLine options (sourceFile: string) =
449+
static member TypeCheckWithErrorsAndOptionsAgainstBaseLine options (sourceDirectory:string) (sourceFile: string) =
451450
lock gate <| fun () ->
452-
let absoluteSourceFile = System.IO.Path.Combine(__SOURCE_DIRECTORY__, "..", sourceFile)
451+
let absoluteSourceFile = System.IO.Path.Combine(sourceDirectory, sourceFile)
453452
let parseResults, fileAnswer =
454453
checker.ParseAndCheckFileInProject(
455454
sourceFile,
@@ -473,7 +472,7 @@ let main argv = 0"""
473472
let errorsActual =
474473
typeCheckResults.Errors
475474
|> Array.map (sprintf "%A")
476-
|> String.concat "\n"
475+
|> String.concat "\n"
477476
File.WriteAllText(Path.ChangeExtension(absoluteSourceFile,"err"), errorsActual)
478477

479478
Assert.AreEqual(errorsExpectedBaseLine.Replace("\r\n","\n"), errorsActual.Replace("\r\n","\n"))
@@ -489,7 +488,7 @@ let main argv = 0"""
489488
{ defaultProjectOptions with OtherOptions = Array.append options defaultProjectOptions.OtherOptions})
490489
|> Async.RunSynchronously
491490

492-
if parseResults.Errors.Length > 0 then
491+
if parseResults.Errors.Length > 0 then
493492
parseResults.Errors
494493
else
495494

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<Project>
2+
3+
<PropertyGroup>
4+
<UseFSharpProductVersion>true</UseFSharpProductVersion>
5+
</PropertyGroup>
6+
7+
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
8+
9+
</Project>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project Sdk="Microsoft.NET.Sdk">
3+
<PropertyGroup>
4+
<TargetFrameworks>net472;netcoreapp3.0</TargetFrameworks>
5+
<TargetFrameworks Condition="'$(OS)' == 'Unix'">netcoreapp3.0</TargetFrameworks>
6+
<RuntimeIdentifiers>win-x86;win-x64</RuntimeIdentifiers>
7+
<AssetTargetFallback>$(AssetTargetFallback);portable-net45+win8+wp8+wpa81</AssetTargetFallback>
8+
<ReferenceVsAssemblies>true</ReferenceVsAssemblies>
9+
<OutputType>Library</OutputType>
10+
<DisableImplicitFSharpCoreReference>true</DisableImplicitFSharpCoreReference>
11+
<Optimize>false</Optimize>
12+
<Tailcalls>false</Tailcalls>
13+
<OtherFlags>$(OtherFlags) --warnon:1182</OtherFlags>
14+
</PropertyGroup>
15+
16+
<ItemGroup>
17+
<Compile Include="..\..\src\scripts\scriptlib.fsx">
18+
<Link>scriptlib.fsx</Link>
19+
</Compile>
20+
<Compile Include="TestFramework.fs" />
21+
<Compile Include="ILChecker.fs" />
22+
<Compile Include="Utilities.fs" />
23+
<Compile Include="CompilerAssert.fs" />
24+
</ItemGroup>
25+
26+
<ItemGroup>
27+
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Compiler.Private\FSharp.Compiler.Private.fsproj" />
28+
<ProjectReference Include="$(FSharpSourcesRoot)\fsharp\FSharp.Core\FSharp.Core.fsproj" />
29+
</ItemGroup>
30+
31+
<ItemGroup>
32+
<PackageReference Include="Microsoft.Net.Compilers" Version="$(MicrosoftNetCompilersVersion)" />
33+
<PackageReference Include="Microsoft.NETCore.ILDAsm" Version="$(MicrosoftNETCoreILDAsmVersion)" />
34+
<PackageReference Include="Microsoft.NETCore.ILAsm" Version="$(MicrosoftNETCoreILAsmVersion)" />
35+
<PackageReference Include="System.Collections.Immutable" Version="$(SystemCollectionsImmutableVersion)" />
36+
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
37+
<PackageReference Include="System.Reflection.Metadata" Version="$(SystemReflectionMetadataVersion)" />
38+
<PackageReference Include="System.Runtime.Loader" Version="$(SystemRuntimeLoaderVersion)" />
39+
<PackageReference Include="Microsoft.CodeAnalysis.Workspaces.Common" Version="$(MicrosoftCodeAnalysisWorkspacesCommonVersion)" />
40+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="$(MicrosoftCodeAnalysisCSharpVersion)" />
41+
<PackageReference Include="Microsoft.CodeAnalysis.Test.Resources.Proprietary" Version="$(MicrosoftCodeAnalysisTestResourcesProprietaryVersion)" />
42+
<PackageReference Include="NUnit" Version="$(NUnitVersion)" />
43+
</ItemGroup>
44+
</Project>

tests/fsharp/Compiler/ILChecker.fs renamed to tests/FSharp.TestHelpers/ILChecker.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
22

3-
namespace FSharp.Compiler.UnitTests
3+
namespace FSharp.TestHelpers
44

55
open System
66
open System.IO

tests/fsharp/test-framework.fs renamed to tests/FSharp.TestHelpers/TestFramework.fs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Copyright (c) Microsoft Corporation. All Rights Reserved. See License.txt in the project root for license information.
2+
13
module TestFramework
24

35
open Microsoft.Win32
@@ -7,7 +9,6 @@ open System.Text.RegularExpressions
79
open Scripting
810
open NUnit.Framework
911

10-
1112
[<RequireQualifiedAccess>]
1213
module Commands =
1314

0 commit comments

Comments
 (0)