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

Commitd7899c7

Browse files
committed
merge visualfsharp
2 parents1c8bb19 +83208f8 commitd7899c7

File tree

2 files changed

+85
-4
lines changed

2 files changed

+85
-4
lines changed

‎tests/service/ProjectOptionsTests.fs‎

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,19 @@ let ``Project file parsing -- compile files 2``() =
137137
[<Test>]
138138
let``Project file parsing--bad project file``()=
139139
letf= normalizePath(__SOURCE_DIRECTORY__+@"/data/Malformed.fsproj")
140-
letlog= snd(ProjectCracker.GetProjectOptionsFromProjectFileLogged(f))
141-
log.[f]|> should contain"Microsoft.Build.Exceptions.InvalidProjectFileException"
140+
try
141+
ProjectCracker.GetProjectOptionsFromProjectFileLogged(f)|> ignore
142+
failwith"Expected exception"
143+
with e->
144+
Assert.That(e.Message, Contains.Substring"The project file could not be loaded.")
142145

143146
[<Test>]
144147
let``Project file parsing--non-existent project file``()=
145148
letf= normalizePath(__SOURCE_DIRECTORY__+@"/data/DoesNotExist.fsproj")
146-
letlog= snd(ProjectCracker.GetProjectOptionsFromProjectFileLogged(f, enableLogging=true))
147-
log.[f]|> should contain"System.IO.FileNotFoundException"
149+
try
150+
ProjectCracker.GetProjectOptionsFromProjectFileLogged(f, enableLogging=true)|> ignore
151+
with e->
152+
Assert.That(e.Message, Contains.Substring"Could not find file")
148153

149154
[<Test>]
150155
let``Project file parsing--output file``()=
@@ -217,6 +222,19 @@ let ``Project file parsing -- Logging``() =
217222
else
218223
Assert.That(log, Is.StringContaining("""Using "ResolveAssemblyReference" task from assembly "Microsoft.Build.Tasks.Core, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"."""))
219224

225+
[<Test>]
226+
let``Project file parsing--FSharpProjectOptions.SourceFiles contains both fs and fsi files``()=
227+
letprojectFileName= normalizePath(__SOURCE_DIRECTORY__+@"/data/FsAndFsiFiles.fsproj")
228+
letoptions,log= ProjectCracker.GetProjectOptionsFromProjectFileLogged(projectFileName, enableLogging=true)
229+
printfn"%A" log
230+
letexpectedSourceFiles=
231+
[|"Test1File2.fsi"
232+
"Test1File2.fs"
233+
"Test1File1.fs"
234+
"Test1File0.fsi"
235+
"Test1File0.fs"|]
236+
Assert.That(options.SourceFiles|> Array.map Path.GetFileName, Is.EqualTo expectedSourceFiles,"source files")
237+
220238
[<Test>]
221239
let``Project file parsing--Full path``()=
222240
letf= normalizePath(__SOURCE_DIRECTORY__+@"/data/ToolsVersion12.fsproj")
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<ProjectToolsVersion="4.0"DefaultTargets="Build"xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<ConfigurationCondition=" '$(Configuration)' == ''">Debug</Configuration>
5+
<PlatformCondition=" '$(Platform)' == ''">x86</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{116cc2f9-f987-4b3d-915a-34cac04a73da}</ProjectGuid>
9+
<OutputType>Library</OutputType>
10+
<RootNamespace>Test1</RootNamespace>
11+
<AssemblyName>Test1</AssemblyName>
12+
<OutputPath>bin\$(Configuration)\</OutputPath>
13+
<UsePartialTypes>False</UsePartialTypes>
14+
<MinimumVisualStudioVersionCondition="'$(MinimumVisualStudioVersion)' == ''">11</MinimumVisualStudioVersion>
15+
</PropertyGroup>
16+
<PropertyGroupCondition=" '$(Configuration)|$(Platform)' == 'Debug|x86'">
17+
<DebugSymbols>True</DebugSymbols>
18+
<DebugType>full</DebugType>
19+
<Optimize>False</Optimize>
20+
<Tailcalls>False</Tailcalls>
21+
<DefineConstants>DEBUG;TRACE</DefineConstants>
22+
<WarningLevel>3</WarningLevel>
23+
<PlatformTarget>x86</PlatformTarget>
24+
<DocumentationFile>bin\Debug\Test1.xml</DocumentationFile>
25+
</PropertyGroup>
26+
<PropertyGroupCondition=" '$(Configuration)|$(Platform)' == 'Release|x86'">
27+
<DebugType>pdbonly</DebugType>
28+
<Optimize>True</Optimize>
29+
<Tailcalls>True</Tailcalls>
30+
<DefineConstants>TRACE</DefineConstants>
31+
<WarningLevel>3</WarningLevel>
32+
<PlatformTarget>x86</PlatformTarget>
33+
<DocumentationFile>bin\Release\Test1.xml</DocumentationFile>
34+
<DebugSymbols>False</DebugSymbols>
35+
</PropertyGroup>
36+
<ItemGroup>
37+
<ReferenceInclude="FSharp.Core">
38+
<HintPath>..\..\..\packages\Microsoft.Portable.FSharp.Core.4.1.20\lib\profiles\net40\FSharp.Core.dll</HintPath>
39+
</Reference>
40+
<ReferenceInclude="mscorlib" />
41+
<ReferenceInclude="System" />
42+
<ReferenceInclude="System.Core" />
43+
</ItemGroup>
44+
<ItemGroup>
45+
<CompileInclude="Test1File2.fsi" />
46+
<CompileInclude="Test1File2.fs" />
47+
<CompileInclude="Test1File1.fs" />
48+
<CompileInclude="Test1File0.fsi" />
49+
<CompileInclude="Test1File0.fs" />
50+
</ItemGroup>
51+
<ImportProject="..\..\..\packages\FSharp.Compiler.Tools.4.1.23\tools\Microsoft.FSharp.Targets" />
52+
<Choose>
53+
<WhenCondition="($(TargetFrameworkIdentifier) == '.NETStandard' And $(TargetFrameworkVersion) == 'v1.6') Or ($(TargetFrameworkIdentifier) == '.NETCoreApp' And $(TargetFrameworkVersion) == 'v1.0') Or ($(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v4.5')">
54+
<ItemGroup>
55+
<ReferenceInclude="nunit.framework">
56+
<HintPath>..\..\..\packages\NUnit\lib\nunit.framework.dll</HintPath>
57+
<Private>True</Private>
58+
<Paket>True</Paket>
59+
</Reference>
60+
</ItemGroup>
61+
</When>
62+
</Choose>
63+
</Project>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp