-
Notifications
You must be signed in to change notification settings - Fork 214
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
explore using utest for testing the thumb targets #144
Comments
I have a new test suite in compiler-builtins-tester that works on both (*) The powi{s,d}f2 tests are disabled because they don't compile on the thumb targets as we are missing some required intrinsics (e.g. The test suite works like this: For each intrinsic, we randomly generate an integration test file ( Then we just run While checking that this new test suite works, I found these issues: #145, #148 #150 and #151. Two of them affected Also, with this new test suite, we can test the ARM targets which we are ignoring in the current test suite as some unit tests return results, which are correct, but that don't match compiler-rt / gcc_s results, which are wrong / not as accurate. (cc @mattico) I propose we move to this new test system as it has wider (target) coverage and doesn't rely on compiler-rt / gcc_s C code bases. |
Sounds like a great idea to me! |
Big 👍 from me. Having to deal with test failures due to gcc_s returning the wrong answer was extremely frustrating. Are you planning to add the tester to this repo and have it generate test cases on each travis run, or to just use it as a generator and check-in some tests? |
@mattico The former to avoid bloating the repository with giant test files. compiler-rt does the later for its test suite; it contains these MBs big test file that tests all the possible combinations. We could tweak the test generator to produce exhaustive test suites as well. |
How long would exhaustive tests take to run? Presumably it wouldn't be too bad if compiler-rt does it. We could have bors run the exhaustive tests, but just do small/random tests on PR commits. |
@mattico So actually compiler-rt doesn't have exhaustive tests. Their biggest test, for the i128 division intrinsic, has about
From what I have seen, compiling the test files takes longer than running them, even within QEMU. IIRC, compilation time was already in tens of seconds but this is for all the test files / all the intrinsics. |
Yeah, I wouldn't expect exhaustive tests for i128 😆. I'm just a bit concerned about tests randomly uncovering an old error in an unrelated PR just because those specific numbers haven't been tested before. It's probably not a huge issue in practice, though. |
utest is a custom test crate that supports
no_std
targets like the thumb targets. We could use it to test the thumb targets but there are a few complications:utest-cortex-m-qemu, the test runner for thumb targets that works with QEMU emulation, depends on this crate. This means that this crate will appear twice in the dependency graph and that could cause problems.
even if we get
#[test]
working for the thumb targets, quickcheck still won't work / compile for those targets. So we'll have to create unit tests for the thumb targets that don't rely on quickcheck. We could port the compiler-builtins tests, those don't depend on quickcheck and have the advantage that we could move away from comparing compiler-builtins results to libgcc / libcompiler-rt results as well.The text was updated successfully, but these errors were encountered: