saltwater icon indicating copy to clipboard operation
saltwater copied to clipboard

Cross-check rcc against other compilers

Open jyn514 opened this issue 4 years ago • 3 comments

We do this at work for our SQL implementation: https://gitlab.com/YottaDB/DBMS/YDBOcto/-/blob/master/tests/test_helpers.bash.in#L551. The basic idea is to run two compilers on the same code and make sure they agree. We could integrate this with existing assert_compiles, etc. tests and make sure that we're testing the right thing. This would also let us take advantage of the existing test suite without much work.

Inspired by @pythondude325 finding that fn redefinition was testing the wrong thing (https://github.com/jyn514/saltwater/pull/470) - the test passed, but it shouldn't have.

jyn514 avatar Jun 07 '20 20:06 jyn514

This is effectively what I do by testing hexponent against libc's equivalent functions.

pythongirl325 avatar Jun 07 '20 20:06 pythongirl325

Could we do this very naively by just using cc to write the tests?

pythongirl325 avatar Jun 07 '20 21:06 pythongirl325

The way I was planning to do this is modifying https://github.com/jyn514/saltwater/blob/8a52d91ba584925a1c09a409c17ede1f652848f2/tests/utils/mod.rs#L75, etc. to run cc against the code in addition to swcc, yeah.

jyn514 avatar Jun 07 '20 22:06 jyn514