Skip to content

Commit 87283c8

Browse files
committed
Merge pull request #1236 from magicmonty/PicklesHelper
Update Pickles helper to reflect the latest changes to pickles
2 parents 0913ff4 + f3baefa commit 87283c8

File tree

1 file changed

+48
-24
lines changed

1 file changed

+48
-24
lines changed

src/app/FakeLib/PicklesHelper.fs

+48-24
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,29 @@ open Fake
88

99
(*
1010
.\packages\Pickles.CommandLine\tools\pickles.exe --help
11-
Pickles version 2.3.0.0
12-
-f, --feature-directory=VALUE
13-
directory to start scanning recursively for
14-
features
15-
-o, --output-directory=VALUE
16-
directory where output files will be placed
17-
--trfmt, --test-results-format=VALUE
18-
the format of the linked test results
19-
(nunit|xunit)
20-
--lr, --link-results-file=VALUE
21-
the path to the linked test results file (can be
22-
a semicolon-separated list of files)
23-
--sn, --system-under-test-name=VALUE
24-
the name of the system under test
25-
--sv, --system-under-test-version=VALUE
26-
the version of the system under test
27-
-l, --language=VALUE the language of the feature files
28-
--df, --documentation-format=VALUE
29-
the format of the output documentation
30-
-v, --version
31-
-h, -?, --help
11+
Pickles version 2.6.1.0
12+
-f, --feature-directory=VALUE
13+
directory to start scanning recursively for
14+
features
15+
-o, --output-directory=VALUE
16+
directory where output files will be placed
17+
--trfmt, --test-results-format=VALUE
18+
the format of the linked test results
19+
(nunit|xunit)
20+
--lr, --link-results-file=VALUE
21+
the path to the linked test results file (can be
22+
a semicolon-separated list of files)
23+
--sn, --system-under-test-name=VALUE
24+
the name of the system under test
25+
--sv, --system-under-test-version=VALUE
26+
the version of the system under test
27+
-l, --language=VALUE the language of the feature files
28+
--df, --documentation-format=VALUE
29+
the format of the output documentation
30+
-v, --version
31+
-h, -?, --help
32+
--exp, --include-experimental-features
33+
whether to include experimental features
3234
*)
3335

3436
/// Option which allows to specify if failure of pickles should break the build.
@@ -41,7 +43,14 @@ type PicklesErrorLevel =
4143
/// The format of the test results
4244
type TestResultsFormat =
4345
| Nunit
46+
| NUnit
47+
| NUnit3
4448
| XUnit
49+
| XUnit2
50+
| MSTest
51+
| CucumberJSON
52+
| SpecRun
53+
| VSTest
4554

4655
type DocumentationFormat =
4756
| DHTML
@@ -74,6 +83,8 @@ type PicklesParams =
7483
TimeOut : TimeSpan
7584
/// Option which allows to specify if failure of pickles should break the build.
7685
ErrorLevel : PicklesErrorLevel
86+
/// Option which allows to enable some experimental features
87+
IncludeExperimentalFeatures : bool option
7788
}
7889

7990
/// The Pickles default parameters
@@ -91,19 +102,21 @@ type PicklesParams =
91102
/// - `SystemUnderTestVersion` - `None`
92103
/// - `TimeOut` - 5 minutes
93104
/// - `ErrorLevel` - `Error`
105+
/// - `IncludeExperimentalFeatures` - `None`
94106
let PicklesDefaults =
95107
{
96108
ToolPath = findToolInSubPath "pickles.exe" currentDirectory
97109
FeatureDirectory = currentDirectory
98110
FeatureFileLanguage = None
99111
OutputDirectory = currentDirectory @@ "Documentation"
100112
OutputFileFormat = DHTML
101-
TestResultsFormat = Nunit
113+
TestResultsFormat = NUnit
102114
LinkedTestResultFiles = []
103115
SystemUnderTestName = None
104116
SystemUnderTestVersion = None
105117
TimeOut = TimeSpan.FromMinutes 5.
106118
ErrorLevel = Error
119+
IncludeExperimentalFeatures = None
107120
}
108121

109122
let buildPicklesArgs parameters =
@@ -118,15 +131,25 @@ let buildPicklesArgs parameters =
118131
| [] -> None
119132
| _ -> match parameters.TestResultsFormat with
120133
| Nunit -> Some "nunit"
134+
| NUnit -> Some "nunit"
135+
| NUnit3 -> Some "nunit3"
121136
| XUnit -> Some "xunit"
137+
| XUnit2 -> Some "xunit2"
138+
| MSTest -> Some "mstest"
139+
| CucumberJSON -> Some "cucumberjson"
140+
| SpecRun -> Some "specrun"
141+
| VSTest -> Some "vstest"
122142

123143
let linkedResultFiles = match parameters.LinkedTestResultFiles with
124144
| [] -> None
125145
| _ -> parameters.LinkedTestResultFiles
126146
|> Seq.map (fun f -> sprintf "\"%s\"" f)
127147
|> String.concat ";"
128148
|> Some
129-
149+
let experimentalFeatures = match parameters.IncludeExperimentalFeatures with
150+
| Some true -> Some "--exp"
151+
| _ -> None
152+
130153
new StringBuilder()
131154
|> appendWithoutQuotes (sprintf " -f \"%s\"" parameters.FeatureDirectory)
132155
|> appendWithoutQuotes (sprintf " -o \"%s\"" parameters.OutputDirectory)
@@ -136,6 +159,7 @@ let buildPicklesArgs parameters =
136159
|> appendWithoutQuotes (sprintf " --df %s" outputFormat)
137160
|> appendIfSome testResultFormat (sprintf " --trfmt %s")
138161
|> appendIfSome linkedResultFiles (sprintf " --lr %s")
162+
|> appendIfSome experimentalFeatures (sprintf "%s")
139163
|> toText
140164

141165
module internal ResultHandling =
@@ -184,4 +208,4 @@ let Pickles setParams =
184208

185209
ResultHandling.failBuildIfPicklesReportedError parameters.ErrorLevel result
186210

187-
traceEndTask "Pickles" ""
211+
traceEndTask "Pickles" ""

0 commit comments

Comments
 (0)