@@ -9,13 +9,22 @@ open Microsoft.FSharp.Reflection
99open System
1010open Bullseye
1111
12+ type TestSuite = All | Unit | Integration
13+ with
14+ member this.SuitName =
15+ match FSharpValue.GetUnionFields( this, typeof< TestSuite>) with
16+ | case, _ -> case.Name.ToLowerInvariant()
17+
1218type Build =
1319 | [<CliPrefix( CliPrefix.None); SubCommand>] Clean
1420 | [<CliPrefix( CliPrefix.None); SubCommand>] Version
1521 | [<CliPrefix( CliPrefix.None); Hidden; SubCommand>] Compile
1622 | [<CliPrefix( CliPrefix.None); SubCommand>] Build
23+
1724 | [<CliPrefix( CliPrefix.None); SubCommand>] Test
18-
25+ | [<CliPrefix( CliPrefix.None); SubCommand>] Unit_ Test
26+ | [<CliPrefix( CliPrefix.None); SubCommand>] Integrate
27+
1928 | [<CliPrefix( CliPrefix.None); SubCommand>] Format
2029 | [<CliPrefix( CliPrefix.None); SubCommand>] Watch
2130
@@ -33,6 +42,7 @@ type Build =
3342 | [<Inherit; AltCommandLine( " -s" ) >] Single_ Target
3443 | [<Inherit>] Token of string
3544 | [<Inherit; AltCommandLine( " -c" ) >] Skip_ Dirty_ Check
45+ | [<Inherit; EqualsAssignment>] Test_ Suite of TestSuite
3646with
3747 interface IArgParserTemplate with
3848 member this.Usage =
4151 | Clean -> " clean known output locations"
4252 | Version -> " print version information"
4353 | Build -> " Run build"
44-
45- | Test -> " runs a clean build and then runs all the tests "
54+
55+ | Unit_ Test -> " alias to providing: test --test-suite=unit"
56+ | Integrate -> " alias to providing: test --test-suite=integration"
57+ | Test -> " runs a clean build and then runs all the tests unless --test-suite is provided"
58+
4659 | Release -> " runs build, tests, and create and validates the packages shy of publishing them"
4760 | Publish -> " Publishes artifacts"
4861 | Format -> " runs dotnet format"
6275 | Single_ Target -> " Runs the provided sub command without running their dependencies"
6376 | Token _ -> " Token to be used to authenticate with github"
6477 | Skip_ Dirty_ Check -> " Skip the clean checkout check that guards the release/publish targets"
78+ | Test_ Suite _ -> " Specify the test suite to run, defaults to all"
6579
6680 member this.StepName =
6781 match FSharpValue.GetUnionFields( this, typeof< Build>) with
87101 let dependsOn = if singleTarget then [] else dependsOn
88102
89103 let steps = dependsOn @ composedOf |> List.map _. StepName
90- Targets.Target( target.StepName, steps, Action( fun _ -> action parsed))
104+ Targets.Target( target.StepName, steps, Action( fun _ -> action parsed))
0 commit comments