Branch coverage 100% - #3594
Conversation
I'm new to this so this might be wrong, but for Chrysler address 514 for is only on bus 514 (0x202) (and then I squash these rest) safety/gm: remove redundant bus check safety/ford: remove redundant bus check safety/mazda: remove redundant bus checks safety/subaru: remove redundant bus checks safety/toyota: remove redundant bus check safety/volkwagen: remove redundant bus checks
I don't actually know if this was required since that was unrelated to branching, but oh well
I don't know if this is quite okay, but those functions are fundamental and weird to test from the python, so I hope its okay
I'm not sold on how I did this, but it does hit 100% for the file
It is acceptable to remove the gm_pcm_cruise branch in gm.h because (at least currently) gm_pcm_cruise is true iff gm_hw == GM_CAM iff 0x1E1 has a defined tx_check.
Removing the longitudinal check /should/ be fine since the two callers already ensure that it isn't longitudinal
I used Terra for the safety_tick_rx_check ones, but it seems reasonable and matches the test cases
The names were swapped for the raw vs val which was a bit of a pain, so I fixed it.
There was a problem hiding this comment.
Thanks for contributing to opendbc! In order for us to review your PR as quickly as possible, check the following:
- Convert your PR to a draft unless it's ready to review
- Read the contributing docs
- Before marking as "ready for review", ensure:
- the goal is clearly stated in the description
- all the tests are passing
- include a route or your device' dongle ID if relevant
ef6de23 to
25e97b0
Compare
|
Huh, it looks like my usage of llvm-cov instead of gc-cov (or whatever its called) is causing discrepancies, even though thats the current default here |
|
Nope, the issue is actually the machine architecture, I guess arm simply has better machine code |
|
I got to use WSL to get the rest of it over the finish line lol. I'm gonna mark this as ready for review because although the last test cancelled it was just because it timed out for the car diff job to finish before it would comment it here (and the dependency action has succeeded now but I can't figure out how to have it re-run the cancelled check like I can when a commit check fails). |
I noticed the branch coverage bounty about two weeks ago, and not seeing any work on it listed in a few months I figured I'd give it a go.
Completes #2557 (and I can actually say that if you check out the branch and run the tests you will in fact achieve 100% on the report, unlike some of the AI PRs). I developed this on an M1 MacBook Air, I don't know if that might cause any regressions in coverage.
Notes:
I am of course ready to go through the back-and-forth of code review, so if there are any changes that should be made for the completion of the PR/bounty please let me know!