Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit86c023b

Browse files
ncaveKevinRansom
authored andcommitted
Fixed FCS netcore tests (#4180)
1 parentdf20c32 commit86c023b

File tree

9 files changed

+44
-48
lines changed

9 files changed

+44
-48
lines changed

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,3 +125,5 @@ tests/fsharpqa/testenv/bin/System.ValueTuple.dll
125125
/tests/fcs/
126126
/fcs/.paket/Paket.Restore.targets
127127
msbuild.binlog
128+
/fcs/FSharp.Compiler.Service.netstandard/*.fs
129+
/fcs/FSharp.Compiler.Service.netstandard/*.fsi

‎fcs/FSharp.Compiler.Service.Tests.netcore/FSharp.Compiler.Service.Tests.netcore.fsproj‎

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<ProjectSdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3-
<TargetFramework>netcoreapp1.0</TargetFramework>
4-
<DefineConstants>$(DefineConstants);DOTNETCORE;FX_ATLEAST_45;FX_ATLEAST_PORTABLE;FX_NO_RUNTIMEENVIRONMENT;FX_RESHAPED_REFLECTION;TODO_REWORK_ASSEMBLY_LOAD;</DefineConstants>
3+
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<DefineConstants>$(DefineConstants);DOTNETCORE</DefineConstants>
5+
<DefineConstants>$(DefineConstants);FX_ATLEAST_45</DefineConstants>
6+
<DefineConstants>$(DefineConstants);FX_ATLEAST_PORTABLE</DefineConstants>
7+
<DefineConstants>$(DefineConstants);FX_NO_RUNTIMEENVIRONMENT</DefineConstants>
8+
<DefineConstants>$(DefineConstants);FX_RESHAPED_REFLECTION</DefineConstants>
9+
<DefineConstants>$(DefineConstants);NO_EXTENSIONTYPING</DefineConstants>
10+
<DefineConstants>$(DefineConstants);TODO_REWORK_ASSEMBLY_LOAD</DefineConstants>
511
<NoWarn>$(NoWarn);44;</NoWarn>
612
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
713
<DelaySign>true</DelaySign>
@@ -36,25 +42,21 @@
3642
<!--<Compile Include="../service/ProjectAnalysisTests.fs">
3743
<Link>ProjectAnalysisTests.fs</Link>
3844
</Compile>-->
45+
<CompileInclude="../../tests/service/Program.fs">
46+
<Link>Program.fs</Link>
47+
</Compile>
3948
</ItemGroup>
4049
<ItemGroup>
4150
<ProjectReferenceInclude="../FSharp.Compiler.Service.netstandard/FSharp.Compiler.Service.netstandard.fsproj" />
4251
</ItemGroup>
4352
<ItemGroup>
44-
<PackageReferenceInclude="Microsoft.NET.Test.Sdk"Version="15.0.0" />
45-
<PackageReferenceInclude="NUnit3TestAdapter"Version="3.8.0" />
46-
<PackageReferenceInclude="NUnitLite"Version="3.6.1" />
47-
<PackageReferenceInclude="NUnit"Version="3.6.1" />
48-
<PackageReferenceInclude="FSharp.Core"Version="4.1.*"PrivateAssets="All" />
49-
<PackageReferenceInclude="System.Runtime"Version="4.3.0" />
50-
<PackageReferenceInclude="System.Reflection.Emit"Version="4.3.0" />
51-
<PackageReferenceInclude="System.Reflection.Metadata"Version="1.4.1" />
52-
<PackageReferenceInclude="System.Reflection.TypeExtensions"Version="4.3.0" />
53-
<PackageReferenceInclude="System.Runtime.Loader"Version="4.3.0" />
54-
<PackageReferenceInclude="Dotnet.ProjInfo"Version="0.5.0" />
53+
<PackageReferenceInclude="Microsoft.NET.Test.Sdk"Version="15.5.0" />
54+
<PackageReferenceInclude="NUnit"Version="3.9.0" />
55+
<PackageReferenceInclude="NUnit3TestAdapter"Version="3.9.0" />
56+
<PackageReferenceInclude="Dotnet.ProjInfo"Version="0.9.0" />
5557
</ItemGroup>
5658
<TargetName="PrecompileScript"BeforeTargets="BeforeBuild">
57-
<ExecCommand="dotnet restore&quot;$(MSBuildProjectDirectory)/../../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard1.6/Sample_NETCoreSDK_FSharp_Library_netstandard1.6.fsproj&quot;" />
58-
<ExecCommand="dotnet build&quot;$(MSBuildProjectDirectory)/../../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard1.6/Sample_NETCoreSDK_FSharp_Library_netstandard1.6.fsproj&quot;" />
59+
<ExecCommand="dotnet restore&quot;$(MSBuildProjectDirectory)/../../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj&quot;" />
60+
<ExecCommand="dotnet build&quot;$(MSBuildProjectDirectory)/../../tests/projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0/Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj&quot;" />
5961
</Target>
6062
</Project>
Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
<ProjectSdk="FSharp.NET.Sdk;Microsoft.NET.Sdk">
1+
<ProjectSdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
33
<TargetFramework>netstandard1.6</TargetFramework>
4-
<DebugType>portable</DebugType>
4+
<!-- <DebugType>portable</DebugType>-->
55
</PropertyGroup>
66
<ItemGroup>
77
<CompileInclude="Library1.fs" />
88
</ItemGroup>
9-
<ItemGroup>
10-
<PackageReferenceInclude="FSharp.Core"Version="4.1.*" />
11-
<PackageReferenceInclude="FSharp.NET.Sdk"Version="1.0.*"PrivateAssets="All" />
12-
</ItemGroup>
139
</Project>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
namespaceSample_NETCoreSDK_FSharp_Library_netstandard2_0
2+
3+
typeClass1()=
4+
memberthis.X="F#"
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<ProjectSdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>netstandard2.0</TargetFramework>
4+
</PropertyGroup>
5+
<ItemGroup>
6+
<CompileInclude="Library1.fs" />
7+
</ItemGroup>
8+
</Project>

‎tests/service/Common.fs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ let readRefs (folder : string) (projectFile: string) =
2929
letexitCode= p.ExitCode
3030
exitCode,()
3131

32+
letprojFilePath= Path.Combine(folder, projectFile)
3233
letrunCmd exePath args= runProcess folder exePath(args|> String.concat"")
3334
letmsbuildExec= Dotnet.ProjInfo.Inspect.dotnetMsbuild runCmd
34-
letresult= Dotnet.ProjInfo.Inspect.getProjectInfo ignore msbuildExec Dotnet.ProjInfo.Inspect.getFscArgs[]projectFile
35+
letresult= Dotnet.ProjInfo.Inspect.getProjectInfo ignore msbuildExec Dotnet.ProjInfo.Inspect.getFscArgs[]projFilePath
3536
match resultwith
3637
| Ok(Dotnet.ProjInfo.Inspect.GetResult.FscArgs x)->
3738
x
@@ -101,8 +102,8 @@ let fsCoreDefaultReference() =
101102

102103
letmkStandardProjectReferences()=
103104
#if DOTNETCORE
104-
letfile="Sample_NETCoreSDK_FSharp_Library_netstandard1.6.fsproj"
105-
letprojDir= Path.Combine(__SOURCE_DIRECTORY__,"../projects/Sample_NETCoreSDK_FSharp_Library_netstandard1.6")
105+
letfile="Sample_NETCoreSDK_FSharp_Library_netstandard2_0.fsproj"
106+
letprojDir= Path.Combine(__SOURCE_DIRECTORY__,"../projects/Sample_NETCoreSDK_FSharp_Library_netstandard2_0")
106107
readRefs projDir file
107108
#else
108109
[yield sysLib"mscorlib"

‎tests/service/EditorTests.fs‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,12 @@ open Microsoft.FSharp.Compiler.SourceCodeServices
3636
openFSharp.Compiler.Service.Tests.Common
3737

3838
letstringMethods=
39-
#if DOTNETCORE
40-
["Chars";"CompareTo";"Contains";"CopyTo";"EndsWith";"Equals";
41-
"GetHashCode";"GetType";"IndexOf";
42-
"IndexOfAny";"Insert";"LastIndexOf";"LastIndexOfAny";
43-
"Length";"PadLeft";"PadRight";"Remove";"Replace";"Split";
44-
"StartsWith";"Substring";"ToCharArray";"ToLower";"ToLowerInvariant";
45-
"ToString";"ToUpper";"ToUpperInvariant";"Trim";"TrimEnd";"TrimStart"]
46-
#else
4739
["Chars";"Clone";"CompareTo";"Contains";"CopyTo";"EndsWith";"Equals";
4840
"GetEnumerator";"GetHashCode";"GetType";"GetTypeCode";"IndexOf";
4941
"IndexOfAny";"Insert";"IsNormalized";"LastIndexOf";"LastIndexOfAny";
5042
"Length";"Normalize";"PadLeft";"PadRight";"Remove";"Replace";"Split";
5143
"StartsWith";"Substring";"ToCharArray";"ToLower";"ToLowerInvariant";
5244
"ToString";"ToUpper";"ToUpperInvariant";"Trim";"TrimEnd";"TrimStart"]
53-
#endif
5445

5546
letinput=
5647
"""
@@ -582,7 +573,8 @@ let test3 = System.Text.RegularExpressions.RegexOptions.Compiled
582573
|> Array.choose(fun s->match s.Symbolwith:? FSharpEntityas ewhen e.IsEnum-> Some e|_-> None)
583574
|> Array.distinct
584575
|> Array.map(fun e->(e.DisplayName, e.FSharpFields
585-
|> Seq.map(fun f-> f.Name, f.LiteralValue)
576+
|> Seq.sortBy(fun f->match f.LiteralValuewith None->-1| Some x-> unbox x)
577+
|> Seq.map(fun f-> f.Name, f.LiteralValue)
586578
|> Seq.toList))
587579

588580
enums|> shouldEqual

‎tests/service/PerfTests.fs‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,15 @@ let ``Test request for parse and check doesn't check whole project`` () =
6565
letpE,tE= FSharpChecker.GlobalForegroundParseCountStatistic, FSharpChecker.GlobalForegroundTypeCheckCountStatistic
6666
(pE- pD)|> shouldEqual0
6767
(tE- tD)|> shouldEqual1
68-
(backgroundParseCount.Value<=8)|> shouldEqualtrue// but note, the project does not get reparsed
69-
(backgroundCheckCount.Value<=8)|> shouldEqualtrue// only two extra typechecks of files
68+
(backgroundParseCount.Value<=9)|> shouldEqualtrue// but note, the project does not get reparsed
69+
(backgroundCheckCount.Value<=9)|> shouldEqualtrue// only two extra typechecks of files
7070

7171
// A subsequent ParseAndCheck of identical source code doesn't do any more anything
7272
letcheckResults2= checker.ParseAndCheckFileInProject(Project1.fileNames.[7],0, Project1.fileSources2.[7], Project1.options)|> Async.RunSynchronously
7373
letpF,tF= FSharpChecker.GlobalForegroundParseCountStatistic, FSharpChecker.GlobalForegroundTypeCheckCountStatistic
7474
(pF- pE)|> shouldEqual0// note, no new parse of the file
7575
(tF- tE)|> shouldEqual0// note, no new typecheck of the file
76-
(backgroundParseCount.Value<=8)|> shouldEqualtrue// but note, the project does not get reparsed
77-
(backgroundCheckCount.Value<=8)|> shouldEqualtrue// only two extra typechecks of files
78-
76+
(backgroundParseCount.Value<=9)|> shouldEqualtrue// but note, the project does not get reparsed
77+
(backgroundCheckCount.Value<=9)|> shouldEqualtrue// only two extra typechecks of files
7978
()
8079

‎tests/service/Program.fs‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
openSystem
2-
openSystem.IO
3-
openSystem.Reflection
4-
openNUnitLite
5-
openNUnit.Common
6-
7-
typeprivateTypeInThisAssembly=classend
82

93
[<EntryPoint>]
104
letmain argv=
115
printfn"Dotnet Core NUnit Tests..."
12-
letwriter=new ExtendedTextWrapper(Console.Out)
13-
letrunner=new AutoRun(typeof<TypeInThisAssembly>.GetTypeInfo().Assembly)
14-
runner.Execute(argv, writer, Console.In)
6+
0

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp