Skip to content
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

[LOWCAR] Make lowcar test framework #206

Open
benliao1 opened this issue Apr 1, 2021 · 0 comments
Open

[LOWCAR] Make lowcar test framework #206

benliao1 opened this issue Apr 1, 2021 · 0 comments
Labels
enhancement New feature or request testing Code that demonstrates code behavior
Milestone

Comments

@benliao1
Copy link
Collaborator

benliao1 commented Apr 1, 2021

I have wanted to do this for a long time, and the debugging with Shepherd that we did has made me realize how important it would be to know that for certain that the logic in the lowcar code actually works. One idea that that I've had is the following:

  1. Create some sort of "fake Arduino.h" which defines all of the functions that we currently use on the Arduinos, like Serial.begin(), Serial.read, Serial.write, pinMode, digitalWrite, digitalRead, analogWrite, analogRead, delay, and maybe a few others. But essentially, we would create a fake Arduino header which the lowcar code would include, and when it called Serial.write, it would actually be printing into a buffer or something for us to check later; when it calls digitalWrite it writes it to some state which we can use to check that the code actually writes to the desired pin, etc.
  2. Make a wrapper that runs the lowcar code the way it's supposed to be run, i.e. run the setup function once, then run the loop function indefinitely. We may need to throttle the loop to simulate running on the 16 MHz chips on the Arduinos
  3. Come up with some general-ish way to test the lowcar code, or at least the messaging protocol with some of the more basic lowcar devices where we can write a test case that sends commands to the code (mimicking dev_handler) and also provides data on the pins as needed (mimicking pin readings on the Arduino), and then can check the outputs by reading the outputs on the serial connection and also the outputs to the pins.

This is likely going to be a big project for whoever wants to try to do it. But this would be a really great addition to the Runtime library, or even downright necessary if we are going to make lowcar it's open repo over the summer and import it into Runtime as a submodule.

@benliao1 benliao1 added enhancement New feature or request testing Code that demonstrates code behavior labels Apr 1, 2021
@benliao1 benliao1 added this to the 1.2 milestone Apr 1, 2021
@levincent06 levincent06 removed their assignment Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request testing Code that demonstrates code behavior
Projects
None yet
Development

No branches or pull requests

2 participants