Skip to content

feat(test_driver): implementation with a new common approach#31

Closed
erhankur wants to merge 2 commits intomasterfrom
reorganize_common_flow
Closed

feat(test_driver): implementation with a new common approach#31
erhankur wants to merge 2 commits intomasterfrom
reorganize_common_flow

Conversation

@erhankur
Copy link
Collaborator

@erhankur erhankur commented Oct 10, 2025

The driver functions were previously empty with no abstraction layer, requiring target specific implementations to be written for each chip. Too much work.

In this PR, I would like to show 2 approach to fix this problem.

  1. In the 2nd commit, implemented an abstraction layer using weak functions only for the test driver module:
┌─────────────────────────────────────────┐
│  Stub calls: stub_lib_test_drv_whoami() │
└──────────────┬──────────────────────────┘
               │ (calls)
               ▼
┌─────────────────────────────────────────┐
│ stub_target_test_drv_whoami()           │ ◄─ Weak (default) in the common folder
│   in common/src/test_drv.c              │
└─────────────────────────────────────────┘
               ▲
               │ (override)
               │
┌─────────────────────────────────────────┐
│ stub_target_test_drv_whoami()           │ ◄─ ESP32 override
│   in esp32/src/test_drv.c               │
└─────────────────────────────────────────┘
  1. The ops structure approach (First commit) would make sense if we were building a single binary that runs on multiple targets and needs to detect/switch at runtime. But that's not our architecture. Compile time polymorphism is what we need. (2nd commit)

@github-actions
Copy link

github-actions bot commented Oct 10, 2025

Messages
📖 🎉 Good Job! All checks are passing!

👋 Hello erhankur, we appreciate your contribution to this project!


Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against c1c44a7

@erhankur erhankur mentioned this pull request Oct 10, 2025
6 tasks
@erhankur
Copy link
Collaborator Author

erhankur commented Oct 13, 2025

This PR is created to show different approaches. We decided to continue with the weak solution only.

@erhankur erhankur closed this Oct 13, 2025
@Dzarda7
Copy link
Collaborator

Dzarda7 commented Oct 13, 2025

Thanks for showing that, I meant it exactly like this. Sorry, not sure if you expected some reaction.

@dobairoland dobairoland deleted the reorganize_common_flow branch November 28, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants