-
Notifications
You must be signed in to change notification settings - Fork 45
chore: generate and compile all .dbc files from test repo #113
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
base: main
Are you sure you want to change the base?
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR integrates test files from the shared-test-files repository as a submodule to enhance test coverage. The changes add multiple DBC (Database Container) file test snapshots from the cantools issue tracker, generating Rust code for various CAN message scenarios including multiplexing, extended IDs, and edge cases.
Changes:
- Added snapshot test files for various cantools issues (issue_63, issue_62, issue_228, issue_207, issue_199, issue_184 variants)
- Generated corresponding Rust code (.snap.rs files) from DBC definitions
- Created snapshot metadata files (.snap) for test verification
Reviewed changes
Copilot reviewed 85 out of 166 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test-snapshots/dbc-cantools/issue_636_negative_scaling.snap | Snapshot metadata for negative scaling test case |
| test-snapshots/dbc-cantools/issue_63.snap.rs | Generated Rust code for AFT1PSI2 message with multiple signal types |
| test-snapshots/dbc-cantools/issue_63.snap | Snapshot metadata for issue 63 |
| test-snapshots/dbc-cantools/issue_62.snap.rs | Generated Rust code for empty messages enum |
| test-snapshots/dbc-cantools/issue_62.snap | Snapshot metadata for issue 62 |
| test-snapshots/dbc-cantools/issue_228.snap.rs | Generated Rust code for signed signal handling (SGMsg, NormalMsg) |
| test-snapshots/dbc-cantools/issue_228.snap | Snapshot metadata for issue 228 |
| test-snapshots/dbc-cantools/issue_207_sig_plus.snap.rs | Generated Rust code for signals with plus notation |
| test-snapshots/dbc-cantools/issue_207_sig_plus.snap | Snapshot metadata for sig_plus variant |
| test-snapshots/dbc-cantools/issue_199_extended.snap.rs | Generated Rust code for extended CAN IDs with vehicle control messages |
| test-snapshots/dbc-cantools/issue_199_extended.snap | Snapshot metadata for extended variant |
| test-snapshots/dbc-cantools/issue_199.snap.rs | Generated Rust code for standard CAN IDs with vehicle control messages |
| test-snapshots/dbc-cantools/issue_199.snap | Snapshot metadata for issue 199 |
| test-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values_dumped.snap.rs | Generated Rust code for extended multiplexing with multiple values (dumped variant) |
| test-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values_dumped.snap | Snapshot metadata for dumped variant |
| test-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values.snap.rs | Generated Rust code for extended multiplexing with multiple values |
| test-snapshots/dbc-cantools/issue_184_extended_mux_multiple_values.snap | Snapshot metadata for multiple values variant |
| test-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap.rs | Generated Rust code for independent multiplexors (dumped variant) |
| test-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors_dumped.snap | Snapshot metadata for dumped multiplexors |
| test-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap.rs | Generated Rust code for independent multiplexors |
| test-snapshots/dbc-cantools/issue_184_extended_mux_independent_multiplexors.snap | Snapshot metadata for independent multiplexors |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Error reading dbc test files from {dir_display} | ||
| {e} | ||
| Make sure git submodules are up to date by running | ||
| git submodule update --init --recursive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
directory exists in my case, but submodule wasnt pulled. Maybe we could check if there are any files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx, I added a test for that too
This PR adds https://github.com/oxibus/shared-test-files as a submodule and uses them for testing -- similar to can-dbc and can-dbc-pest repos. Note that there is a minor change to the lib.rs to handle missing signal name - rather than crashing. Other than that, the goal of this PR is NOT to fix issues, but to record the status quo. This way any changes to the generation logic will be clearly visible in the test files.
.dbcfiles are converted to .rs binary snapshots (update withjust bless), and are later compiled to ensure the result is usable.stderrfiles. Warnings are treated as errors.opendbcrepo is also used as a test case, but due to the size, the files are only used for generation testing, not compilation. All errors are saved as!error___*.snapfiles.