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

Commitaedb22f

Browse files
committed
Merge branch 'fsharp4' into VS2015Support
Conflicts:.gitignore
2 parentseabe055 +5e24472 commitaedb22f

File tree

10 files changed

+10608
-134
lines changed

10 files changed

+10608
-134
lines changed

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ aclocal.m4
1010
src/*.userprefs
1111
src/fsharp/FSStrings.resources
1212
lkg
13-
pack
13+
packages
1414
packages
1515
src/fsharp/FSharp.Build/*.resx
1616
src/fsharp/FSharp.Build-proto/*.resx

‎src/fsharp/FSharp.Core.Unittests/FSharp.Core.Unittests.fsproj‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,22 +29,22 @@
2929
</PropertyGroup>
3030
<PropertyGroup>
3131
<DefineConstantsCondition=" '$(TargetFramework)' == 'sl5'">$(DefineConstants);SILVERLIGHT</DefineConstants>
32-
<DefineConstants>$(DefineConstants);EXTENSIONTYPING</DefineConstants>
32+
<DefineConstants>$(DefineConstants);EXTENSIONTYPING;$(TargetFramework)</DefineConstants>
3333
</PropertyGroup>
3434
<PropertyGroupCondition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
3535
<DebugSymbols>true</DebugSymbols>
3636
<DebugType>full</DebugType>
3737
<Optimize>false</Optimize>
3838
<OutputPath>bin\Debug\</OutputPath>
39-
<DefineConstants>DEBUG;TRACE</DefineConstants>
39+
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
4040
<ErrorReport>prompt</ErrorReport>
4141
<WarningLevel>3</WarningLevel>
4242
</PropertyGroup>
4343
<PropertyGroupCondition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
4444
<DebugType>pdbonly</DebugType>
4545
<Optimize>true</Optimize>
4646
<OutputPath>bin\Release\</OutputPath>
47-
<DefineConstants>TRACE</DefineConstants>
47+
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
4848
<ErrorReport>prompt</ErrorReport>
4949
<WarningLevel>3</WarningLevel>
5050
</PropertyGroup>
@@ -107,7 +107,7 @@
107107
<CompileInclude="FSharp.Core\Microsoft.FSharp.Quotations\FSharpQuotations.fs" />
108108
<CompileInclude="TypeForwarding.fs" />
109109
<CompileInclude="NUnitFrameworkShims.fs"Condition="'$(TargetFramework)' == 'sl3-wp'" />
110-
<CompileInclude="SurfaceArea.4.0.fs"Condition="'$(TargetFramework)' == 'net40'"/>
110+
<CompileInclude="SurfaceArea.$(TargetFramework).fs"/>
111111
</ItemGroup>
112112
<ImportProject="$(FSharpSourcesRoot)\FSharpSource.targets" />
113113
<TargetName="BeforeResolveReferences"Condition="'$(UseNugetPackages)'=='true'">

‎src/fsharp/FSharp.Core.Unittests/LibraryTestFx.fs‎

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,67 @@ let sleep(n : int32) =
6767
async{do! Async.Sleep(n)}|> Async.RunSynchronously
6868
#else
6969
System.Threading.Thread.Sleep(n)
70-
#endif
70+
#endif
71+
72+
moduleSurfaceArea=
73+
openSystem.Reflection
74+
openSystem
75+
openSystem.Text.RegularExpressions
76+
77+
// gets string form of public surface area for the currently-loaded FSharp.Core
78+
letprivategetActual()=
79+
80+
// get current fsharp.core
81+
letasm=
82+
#if portable7|| portable78|| portable259
83+
typeof<int list>.GetTypeInfo().Assembly
84+
#else
85+
typeof<int list>.Assembly
86+
#endif
87+
88+
// public types only
89+
lettypes=
90+
#if portable7|| portable78|| portable259
91+
asm.ExportedTypes|> Seq.filter(fun ty->letti= ty.GetTypeInfo()in ti.IsPublic|| ti.IsNestedPublic)|> Array.ofSeq
92+
#else
93+
asm.GetExportedTypes()
94+
#endif
95+
96+
// extract canonical string form for every public member of every type
97+
letgetTypeMemberStrings(t:Type)=
98+
// for System.Runtime-based profiles, need to do lots of manual work
99+
#if portable7|| portable78|| portable259
100+
letgetMembers(t:Type)=
101+
letti= t.GetTypeInfo()
102+
letcast(info:#MemberInfo)=(t, info:> MemberInfo)
103+
seq{
104+
yield! t.GetRuntimeEvents()|> Seq.filter(fun m-> m.AddMethod.IsPublic)|> Seq.map cast
105+
yield! t.GetRuntimeProperties()|> Seq.filter(fun m-> m.GetMethod.IsPublic)|> Seq.map cast
106+
yield! t.GetRuntimeMethods()|> Seq.filter(fun m-> m.IsPublic)|> Seq.map cast
107+
yield! t.GetRuntimeFields()|> Seq.filter(fun m-> m.IsPublic)|> Seq.map cast
108+
yield! ti.DeclaredConstructors|> Seq.filter(fun m-> m.IsPublic)|> Seq.map cast
109+
yield! ti.DeclaredNestedTypes|> Seq.filter(fun ty-> ty.IsNestedPublic)|> Seq.map cast
110+
}|> Array.ofSeq
111+
112+
getMembers t
113+
|> Array.map(fun(ty,m)-> sprintf"%s:%s"(ty.ToString())(m.ToString()))
114+
#else
115+
t.GetMembers()
116+
|> Array.map(fun v-> sprintf"%s:%s"(v.ReflectedType.ToString())(v.ToString()))
117+
#endif
118+
119+
types
120+
|> Array.collect getTypeMemberStrings
121+
|> Array.sort
122+
|> String.concat"\r\n"
123+
124+
// verify public surface area matches expected
125+
letverify expected platform fileName=
126+
letlogFile= sprintf"%s\\CoreUnit_%s_Xml.xml" TestContext.CurrentContext.WorkDirectory platform
127+
letnormalize(s:string)=
128+
Regex.Replace(s,"(\\r\\n|\\n)+","\r\n").Trim([|'\r';'\n'|])
129+
130+
letactual= getActual()|> normalize
131+
letexpected= expected|> normalize
132+
133+
Assert.AreEqual(expected, actual, sprintf"\r\n%s\r\n\r\n Expected and actual surface area don't match. To see the delta, run\r\nwindiff%s%s" actual fileName logFile)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp