Rejig test harness (#68)

This commit is contained in:
Patrick Stevens
2025-06-27 11:54:00 +01:00
committed by GitHub
parent 5cf0789439
commit c859f88f52
21 changed files with 467 additions and 50 deletions

View File

@@ -0,0 +1,18 @@
namespace WoofWare.PawPrint.Test
/// Result of executing the program using the real .NET runtime.
type RealRuntimeResult =
{
ExitCode : int
}
[<RequireQualifiedAccess>]
module RealRuntime =
/// Execute an assembly using the real .NET runtime and capture the result.
let executeWithRealRuntime (args : string[]) (assemblyBytes : byte array) : RealRuntimeResult =
let assy = System.Reflection.Assembly.Load assemblyBytes
let result = assy.EntryPoint.Invoke ((null : obj), [| args |]) |> unbox<int>
{
ExitCode = result
}