Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes
Browse files Browse the repository at this point in the history
jgardella committed Jun 10, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 8a83b60 commit d64f221
Showing 13 changed files with 12 additions and 109 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project ToolsVersion="15.0">
<Target Name="FSharpLint"
AfterTargets="BeforeBuild"
Condition="$(MSBuildProjectName) != 'FSharpLint.FunctionalTest.TestedProject'
Condition="$(MSBuildProjectName) != 'FSharpLint.FunctionalTest.TestedProject.NetCore'
And $(MSBuildProjectName) != 'FSharpLint.FunctionalTest.TestedProject.MultiTarget'
And $(MSBuildProjectName) != 'FSharpLint.FunctionalTest.TestedProject.OldProject'
And $(MSBuildProjectName) != 'FSharpLint.Console'
3 changes: 2 additions & 1 deletion build.fsx
Original file line number Diff line number Diff line change
@@ -32,11 +32,12 @@ Target.create "Build" (fun _ -> DotNet.build id "FSharpLint.sln")

let filterPerformanceTests (p:DotNet.TestOptions) = { p with Filter = Some "\"TestCategory!=Performance\""; Configuration = DotNet.Release }

Target.create "RunTests" (fun _ ->
Target.create "RunTests" (fun _ ->
DotNet.test filterPerformanceTests "tests/FSharpLint.Core.Tests"
DotNet.test filterPerformanceTests "tests/FSharpLint.Console.Tests")
Target.create "RunFunctionalTests" (fun _ ->
DotNet.restore id "tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.sln"
DotNet.restore id "tests/FSharpLint.FunctionalTest.TestedProject/FSharpLint.FunctionalTest.TestedProject.OldProject/FSharpLint.FunctionalTest.TestedProject.OldProject.fsproj"
DotNet.test filterPerformanceTests "tests/FSharpLint.FunctionalTest")

Target.create "Package" (fun _ ->
4 changes: 2 additions & 2 deletions src/FSharpLint.Core/Application/Lint.fs
Original file line number Diff line number Diff line change
@@ -423,8 +423,8 @@ module Lint =
match parseFilesInProject (Array.toList projectOptions.SourceFiles) projectOptions with
| Success _ -> lintWarnings |> Seq.toList |> LintResult.Success
| Failure x -> LintResult.Failure x
| Error _ ->
MSBuildFailedToLoadProjectFile (projectFilePath, BuildFailure.InvalidProjectFileMessage "Failed to load project file")
| Error err ->
MSBuildFailedToLoadProjectFile (projectFilePath, BuildFailure.InvalidProjectFileMessage (string err))
|> LintResult.Failure
| Error err ->
RunTimeConfigError err
Original file line number Diff line number Diff line change
@@ -6,5 +6,4 @@
<ItemGroup>
<Compile Include="TestHints.fs" />
</ItemGroup>
<Import Project="..\..\..\.paket\Paket.Restore.targets" />
</Project>
</Project>
Empty file.
Original file line number Diff line number Diff line change
@@ -5,7 +5,5 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="TestHints.fs" />
<PackageReference Include="FSharp.Core" Version="4.3.4" />
</ItemGroup>
<Import Project="..\..\..\.paket\Paket.Restore.targets" />
</Project>
</Project>
Empty file.

This file was deleted.

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
@@ -4,8 +4,6 @@ Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharpLint.FunctionalTest.T
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharpLint.FunctionalTest.TestedProject.MultiTarget", "FSharpLint.FunctionalTest.TestedProject.MultiTarget\FSharpLint.FunctionalTest.TestedProject.MultiTarget.fsproj", "{FE182FFC-EADD-431D-98EC-041FF6B5E270}"
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharpLint.FunctionalTest.TestedProject.OldProject", "FSharpLint.FunctionalTest.TestedProject.OldProject\FSharpLint.FunctionalTest.TestedProject.OldProject.fsproj", "{88CC83C2-CAA4-4331-B310-6D4D73ADA159}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -20,9 +18,5 @@ Global
{FE182FFC-EADD-431D-98EC-041FF6B5E270}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE182FFC-EADD-431D-98EC-041FF6B5E270}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE182FFC-EADD-431D-98EC-041FF6B5E270}.Release|Any CPU.Build.0 = Release|Any CPU
{88CC83C2-CAA4-4331-B310-6D4D73ADA159}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{88CC83C2-CAA4-4331-B310-6D4D73ADA159}.Debug|Any CPU.Build.0 = Debug|Any CPU
{88CC83C2-CAA4-4331-B310-6D4D73ADA159}.Release|Any CPU.ActiveCfg = Release|Any CPU
{88CC83C2-CAA4-4331-B310-6D4D73ADA159}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal
17 changes: 2 additions & 15 deletions tests/FSharpLint.FunctionalTest/TestApi.fs
Original file line number Diff line number Diff line change
@@ -85,19 +85,6 @@ module TestApi =
| LintResult.Failure err ->
Assert.True(false, string err)

[<Test>]
member __.``Lint old-style project``() =
let projectPath = basePath </> "tests" </> "FSharpLint.FunctionalTest.TestedProject" </> "FSharpLint.FunctionalTest.TestedProject.OldProject"
let projectFile = projectPath </> "FSharpLint.FunctionalTest.TestedProject.OldProject.fsproj"

let result = lintProject OptionalLintParameters.Default projectFile

match result with
| LintResult.Success warnings ->
Assert.AreEqual(9, warnings.Length)
| LintResult.Failure err ->
Assert.True(false, string err)

[<Test>]
member __.``Lint solution via absolute path``() =
let projectPath = basePath </> "tests" </> "FSharpLint.FunctionalTest.TestedProject"
@@ -107,7 +94,7 @@ module TestApi =

match result with
| LintResult.Success warnings ->
Assert.AreEqual(27, warnings.Length)
Assert.AreEqual(18, warnings.Length)
| LintResult.Failure err ->
Assert.True(false, string err)

@@ -139,7 +126,7 @@ module TestApi =

match result with
| LintResult.Success warnings ->
Assert.AreEqual(27, warnings.Length)
Assert.AreEqual(18, warnings.Length)
| LintResult.Failure err ->
Assert.True(false, string err)
#endif
6 changes: 3 additions & 3 deletions tests/FSharpLint.FunctionalTest/TestConsoleApplication.fs
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ module Tests =

[<Test>]
member __.InvalidConfig() =
let projectFile = projectPath </> "FSharpLint.FunctionalTest.TestedProject.fsproj"
let projectFile = projectPath </> "FSharpLint.FunctionalTest.TestedProject.NetCore.fsproj"
let lintConfigPath = projectPath </> "fsharplint.json"
let arguments = sprintf "lint --lint-config %s %s" lintConfigPath projectFile

@@ -96,7 +96,7 @@ module Tests =

[<Test>]
member __.FunctionalTestConsoleApplication() =
let projectFile = projectPath </> "FSharpLint.FunctionalTest.TestedProject.fsproj"
let projectFile = projectPath </> "FSharpLint.FunctionalTest.TestedProject.NetCore.fsproj"
let arguments = sprintf "lint %s" projectFile

let output = dotnetFslint arguments
@@ -111,7 +111,7 @@ module Tests =

[<Test>]
member __.FunctionalTestConsoleApplicationSolution() =
let solutionFile = projectPath </> "FSharpLint.FunctionalTest.TestedProject.sln"
let solutionFile = basePath </> "tests" </> "FSharpLint.FunctionalTest.TestedProject" </> "FSharpLint.FunctionalTest.TestedProject.sln"
let arguments = sprintf "lint %s" solutionFile

let output = dotnetFslint arguments

0 comments on commit d64f221

Please sign in to comment.