mirror of
https://github.com/Smaug123/WoofWare.PawPrint
synced 2025-10-11 08:48:38 +00:00
Rejig test harness (#68)
This commit is contained in:
18
WoofWare.PawPrint.Test/RealRuntime.fs
Normal file
18
WoofWare.PawPrint.Test/RealRuntime.fs
Normal 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
|
||||
}
|
Reference in New Issue
Block a user