mirror of
https://github.com/Smaug123/unofficial-nunit-runner
synced 2025-10-08 18:48:40 +00:00
Promote runtime stuff to lib (#74)
This commit is contained in:
51
WoofWare.NUnitTestRunner.Lib/RuntimeConfig.fs
Normal file
51
WoofWare.NUnitTestRunner.Lib/RuntimeConfig.fs
Normal file
@@ -0,0 +1,51 @@
|
||||
namespace WoofWare.NUnitTestRunner
|
||||
|
||||
open System
|
||||
open WoofWare.Myriad.Plugins
|
||||
|
||||
[<JsonParse>]
|
||||
type internal FrameworkDescription =
|
||||
{
|
||||
Name : string
|
||||
Version : string
|
||||
}
|
||||
|
||||
[<JsonParse>]
|
||||
type internal RuntimeOptions =
|
||||
{
|
||||
Tfm : string
|
||||
Framework : FrameworkDescription option
|
||||
Frameworks : FrameworkDescription list option
|
||||
RollForward : string option
|
||||
}
|
||||
|
||||
[<JsonParse>]
|
||||
type internal RuntimeConfig =
|
||||
{
|
||||
RuntimeOptions : RuntimeOptions
|
||||
}
|
||||
|
||||
[<RequireQualifiedAccess>]
|
||||
type internal RollForward =
|
||||
| Minor
|
||||
| Major
|
||||
| LatestPatch
|
||||
| LatestMinor
|
||||
| LatestMajor
|
||||
| Disable
|
||||
|
||||
static member Parse (s : string) : RollForward =
|
||||
if s.Equals ("minor", StringComparison.OrdinalIgnoreCase) then
|
||||
RollForward.Minor
|
||||
elif s.Equals ("major", StringComparison.OrdinalIgnoreCase) then
|
||||
RollForward.Major
|
||||
elif s.Equals ("latestpatch", StringComparison.OrdinalIgnoreCase) then
|
||||
RollForward.LatestPatch
|
||||
elif s.Equals ("latestminor", StringComparison.OrdinalIgnoreCase) then
|
||||
RollForward.LatestMinor
|
||||
elif s.Equals ("latestmajor", StringComparison.OrdinalIgnoreCase) then
|
||||
RollForward.LatestMajor
|
||||
elif s.Equals ("disable", StringComparison.OrdinalIgnoreCase) then
|
||||
RollForward.Disable
|
||||
else
|
||||
failwith $"Could not interpret '%s{s}' as a RollForward"
|
Reference in New Issue
Block a user