Open jyn514 opened 4 years ago
This is effectively what I do by testing hexponent
against libc
's equivalent functions.
Could we do this very naively by just using cc
to write the tests?
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.
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.