naggum icon indicating copy to clipboard operation
naggum copied to clipboard

Generify Naggum.Assembler tests

Open ForNeVeR opened this issue 10 years ago • 0 comments

Currently there are handwritten tests such as the folliwing:

[<Fact>]
let ``Hello world program should be executed`` () =
    let source = "(.assembly Hello
  (.method Main () System.Void (.entrypoint)
    (ldstr \"Hello, world!\")
    (call (mscorlib System.Console WriteLine (System.String) System.Void))
    (ret)))
"
    let output = execute source
    Assert.Equal ("Hello, world!\n", output)

We should make the test process more generic (as Naggum.Compiler testing already done): it should read all *.nga files from the test directory, compile them, then execute and verify its outputs and/or return codes against some expected values.

Maybe we could even set up the common infrastructure for both Naggum.Assembler and Naggum.Compiler testing (and detect compiler type by file extension).

ForNeVeR avatar Dec 27 '15 12:12 ForNeVeR