I am making a compiler from (a small subset of) Java to CIL (MSIL) in F# and I was thinking about writing some unit tests for the actual compilation part. Is there a way I could run ilasm on the generated IL code and the run the .exe file from a unit test? I am using NUnit.
Concretely, is there a way to do the following?
[<Test>]
member this.TestSimpleMain () =
let fileName = __SOURCE_DIRECTORY__.Replace("code", "examples\SimpleMain.cil")
// run ilasm on fileName -> should produce ...\SimpleMain.exe
let actualResult = // run ...\SimpleMain.exe file
Assert.That(actualResult , Is.EqualTo("Program returned value 5!")))