Skip to content

Commit

Permalink
Do not assume AppData and ProgramFiles exists in defaultParams
Browse files Browse the repository at this point in the history
This fixes calling OpenCover in Linux/MacOS environments where the
OpenCoverDefault value throws a ArgumentNullException because the '@@'
operator will call Path.Combine to ProgramFiles and AppData which do not
exist in Linux/MacOS environments.

This fix falls back to the behaviour where ExePath and TestRunnerExePath
must be passed explicitly in Mono environments running Linux/MacOS.
  • Loading branch information
rexcfnghk authored and Rex Ng committed May 4, 2016
1 parent 26ea4db commit 6d324a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/FakeLib/OpenCoverHelper.fs
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ type OpenCoverParams =

/// OpenCover default parameters
let OpenCoverDefaults =
{ ExePath = environVar "LOCALAPPDATA" @@ "Apps" @@ "OpenCover" @@ "OpenCover.Console.exe"
TestRunnerExePath = ProgramFiles @@ "NUnit" @@ "bin" @@ "nunit-console.exe"
{ ExePath = if isMono then String.Empty else environVar "LOCALAPPDATA" @@ "Apps" @@ "OpenCover" @@ "OpenCover.Console.exe"
TestRunnerExePath = if isMono then String.Empty else ProgramFiles @@ "NUnit" @@ "bin" @@ "nunit-console.exe"
Output = String.Empty
Register = Manual
Filter = String.Empty
Expand Down

0 comments on commit 6d324a9

Please sign in to comment.