Closed ksolana closed 1 year ago
@aditya-solana I have written a move-mv-llvm-compiler test harness:
It doesn't work exactly as you suggest though.
It is based on converting MVIR to LLVM IR and comparing the result with a reference file, similar to parts of the LLVM and Rust test suite.
It uses the datatest_stable crate, as do most of the other move tests.
It
${testname}.actual.ll
and compares it to ${testname}.expected.ll
Actual test results can be promoted to expected test results. The mechanism I wrote to do this is by setting PROMOTE_LLVM_IR
, which when set will cause the test harness to copy the .actual.ll
files to .expected.ll
. This mechanism could be changed to better match other parts of the move test suite. I haven't looked at it closely.
The .expected.ll
files are checked into git.
Let me know what you think.
Run with cargo test -p move-mv-llvm-compiler --test ir-tests
Hm, currently it requires running cargo build -p move-ir-compiler
first. It does not automatically build it.
This is done. Refinements to the ir-tests can be opened as new issues.
Running cargo test in move/language/tools/move-mv-llvm-compiler should do the following For each .mvir file in move/language/tools/move-mv-llvm-compiler/tests