Rewrite #1
2 changed files with 15 additions and 5 deletions
|
|
@ -11,6 +11,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Argu" Version="6.2.5" />
|
||||||
<PackageReference Include="Fli" Version="1.1000.0" />
|
<PackageReference Include="Fli" Version="1.1000.0" />
|
||||||
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="9.0.1" />
|
<PackageReference Include="System.Reflection.MetadataLoadContext" Version="9.0.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ open System.IO
|
||||||
open System.Reflection
|
open System.Reflection
|
||||||
open System.Runtime.InteropServices
|
open System.Runtime.InteropServices
|
||||||
open Fli
|
open Fli
|
||||||
|
open Argu
|
||||||
|
|
||||||
type MutationCase = { TestName: string; Patch: string }
|
type MutationCase = { TestName: string; Patch: string }
|
||||||
|
|
||||||
|
|
@ -118,18 +119,26 @@ let getMutationCases projectPath =
|
||||||
| _ -> None))
|
| _ -> None))
|
||||||
|> Seq.toList
|
|> Seq.toList
|
||||||
|
|
||||||
|
type Arguments =
|
||||||
|
| [<MainCommand; ExactlyOnce>] ProjectPath of ProjectPath: string
|
||||||
|
|
||||||
|
interface IArgParserTemplate with
|
||||||
|
member s.Usage =
|
||||||
|
match s with
|
||||||
|
| ProjectPath _ -> "path/to/project.csproj|fsproj"
|
||||||
|
|
||||||
[<EntryPoint>]
|
[<EntryPoint>]
|
||||||
let main argv =
|
let main argv =
|
||||||
if argv.Length <> 1 then
|
let parsedArguments =
|
||||||
eprintf "Usage: mutannot <path/to/project.csproj|fsproj>\n"
|
ArgumentParser.Create<Arguments>(programName = "mutannot")
|
||||||
exit 1
|
|> _.ParseCommandLine(argv)
|
||||||
|
|
||||||
|
let projectPath = parsedArguments.GetResult ProjectPath
|
||||||
|
|
||||||
ensureCleanWorkingDirectory ()
|
ensureCleanWorkingDirectory ()
|
||||||
|
|
||||||
AppDomain.CurrentDomain.ProcessExit.Add(fun _ -> restore ())
|
AppDomain.CurrentDomain.ProcessExit.Add(fun _ -> restore ())
|
||||||
|
|
||||||
let projectPath = argv[0]
|
|
||||||
|
|
||||||
for index, mutationCase in getMutationCases projectPath |> Seq.indexed do
|
for index, mutationCase in getMutationCases projectPath |> Seq.indexed do
|
||||||
Console.ForegroundColor <- ConsoleColor.Green
|
Console.ForegroundColor <- ConsoleColor.Green
|
||||||
printf $"MUTATION {index + 1}\n"
|
printf $"MUTATION {index + 1}\n"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue