Dark Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Expectation driven SPI test helper (RFC)#742

Open
jmhobbs wants to merge 3 commits intotinygo-org:devfrom
jmhobbs:spi-tester
Open

Expectation driven SPI test helper (RFC)#742
jmhobbs wants to merge 3 commits intotinygo-org:devfrom
jmhobbs:spi-tester

Conversation

Copy link
Contributor

jmhobbs commented Feb 18, 2025

This is my WAG at an SPI test helper after I wrote #738

It's based on ordered Tx expecations. I also had to make a partial Pin interface as input to my MAX6675, I'm not sure how to finish that out in a meaningful way without machine. I'm not sure if the chip select pin should be part of the test helper or an independent concern.

I'll leave this here as a discussion point, but happy to adjust or expand this as well as try my hand and testing some of the other SPI based drivers to get a feel for the API here.

jmhobbs changed the title Expectation driven SPI test helper Expectation driven SPI test helper (RFC) Feb 18, 2025
Copy link
Member

deadprogram commented Feb 19, 2025

Very cool, I will take a look!

deadprogram reviewed Feb 22, 2025
deadprogram reviewed Feb 22, 2025
Copy link
Member

deadprogram commented Feb 22, 2025

I also had to make a partial Pin interface

We were needing to do something about that probably, however since some drivers do very specific things with Pin we will have to see how far we can take that.

I'm not sure if the chip select pin should be part of the test helper or an independent concern.

A very good question. Since we do that CS "manually" in the drivers, it probably needs to be somehow separated.

jmhobbs force-pushed the spi-tester branch from 46b42e8 to 26de9ec Compare March 13, 2025 02:43
jmhobbs force-pushed the spi-tester branch from 99ed706 to 5d61ae2 Compare March 13, 2025 02:48
jmhobbs marked this pull request as ready for review March 13, 2025 03:03
Copy link
Contributor Author

jmhobbs commented Mar 13, 2025

I added another, very basic expectation based Pin implementation as well. Works for CS at least.

Copy link
Contributor Author

jmhobbs commented Mar 13, 2025

Using something like testify/mock and mockery might be a better direction for these.

deadprogram mentioned this pull request Mar 16, 2025
gandarez reviewed Mar 16, 2025
jmhobbs requested review from deadprogram and gandarez March 20, 2025 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

gandarez Awaiting requested review from gandarez

deadprogram Awaiting requested review from deadprogram

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants