Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the obvious Windows-only tools fail explicitly off the supported platform #2200

Merged
merged 1 commit into from
Nov 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/app/Fake.DotNet.FxCop/FxCop.fs
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,6 @@ let run param (assemblies : string seq) =
composeCommandLine param assemblies
|> Proc.run
|> failAsrequired param
__.MarkSuccess()
__.MarkSuccess()
else
raise <| NotSupportedException("FxCop is currently not supported on mono")
4 changes: 3 additions & 1 deletion src/app/Fake.DotNet.ILMerge/ILMerge.fs
Original file line number Diff line number Diff line change
Expand Up @@ -179,4 +179,6 @@ let run parameters outputFile primaryAssembly =
if 0 <> run.ExitCode then
let args = getArguments outputFile primaryAssembly parameters
failwithf "'ILMerge %s' failed." (String.separated " " args)
__.MarkSuccess()
__.MarkSuccess()
else
raise <| NotSupportedException("ILMerge is currently not supported on mono")
12 changes: 10 additions & 2 deletions src/test/Fake.Core.UnitTests/Fake.DotNet.FxCop.fs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,15 @@ let testCases =
printfn "Unexpected failure %A level=%d index=%d" x level
mapIndex
reraise()) ]
else []
else
[ testCase "Test failure on non-Windows platforms" <| fun _ ->
let p = FxCop.Params.Create()
Expect.throwsC (fun () -> FxCop.run p [])
(fun ex ->
Expect.equal (ex.GetType()) typeof<NotSupportedException>
"Exception type should be as expected"
Expect.equal ex.Message "FxCop is currently not supported on mono"
"Exception message should be as expected") ]

[<Tests>]
let tests = testList "Fake.DotNet.FxCop.Tests" testCases
let tests = testList "Fake.DotNet.FxCop.Tests" testCases
14 changes: 12 additions & 2 deletions src/test/Fake.Core.UnitTests/Fake.DotNet.ILMerge.fs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,17 @@ let testCases =
libs |> Seq.head
libs |> Seq.last ]
"Strings should be assigned as expected" ]
else []
else
[ testCase "Test failure on non-Windows platforms" <| fun _ ->
let p = ILMerge.Params.Create()
let dummy = Guid.NewGuid().ToString()
let dummy2 = Guid.NewGuid().ToString()
Expect.throwsC (fun () -> ILMerge.run p dummy dummy2)
(fun ex ->
Expect.equal (ex.GetType()) typeof<NotSupportedException>
"Exception type should be as expected"
Expect.equal ex.Message "ILMerge is currently not supported on mono"
"Exception message should be as expected") ]

[<Tests>]
let tests = testList "Fake.DotNet.ILMerge.Tests" testCases
let tests = testList "Fake.DotNet.ILMerge.Tests" testCases