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

Add unit testing #36

Open
JelmerT opened this issue Sep 15, 2015 · 3 comments
Open

Add unit testing #36

JelmerT opened this issue Sep 15, 2015 · 3 comments
Assignees

Comments

@JelmerT
Copy link
Owner

JelmerT commented Sep 15, 2015

Figure out how to do some kind of unit testing.

This will be pretty complicated since real hardware is probably needed to do all the tests (and there's currently 3 different supported platforms).

@g-oikonomou
Copy link
Contributor

I was thinking of a second script (or number of scripts) that knows how to reply correctly or incorrectly to specific commands.

Edit: The main script ("host") and the device script would talk over FIFOs. This would be sufficient to test everything except serial transport.

We can then put it on travis (?) and perhaps even look into codeclimate. Or maybe I'm just exaggerating now...

@JelmerT
Copy link
Owner Author

JelmerT commented Sep 17, 2015

Travis sounds good to me, I'll have a look if I can set something up.

I also had a second script in mind that basically emulates the boot loader in the different chips. A CC2XXXBootloaderSim so to say.

FIFOs would work, but what do you think about creating a virtual tty via python (http://askubuntu.com/questions/9396/virtual-serial-port-for-testing-purpose) and connecting the bootloader sim to it on one side, and the script on the other side? That way we can test the script closer to 'the real thing'. Not sure if possible, but this way we could test the clock switch a little better (opening the port at a different speed by the script).

I was also thinking, parallel to the sim that we could run on travis, to have a makefile which goes through all the possible scenarios of uploading firmware per platform (as in chip). This then could be used to quickly check the script with real HW connected to a computer.

@g-oikonomou
Copy link
Contributor

FIFOs would work, but what do you think about creating a virtual tty via python (http://askubuntu.com/questions/9396/virtual-serial-port-for-testing-purpose)

That looks very promising!

I was also thinking, parallel to the sim that we could run on travis, to have a makefile which goes through all the possible scenarios of uploading firmware per platform (as in chip). This then could be used to quickly check the script with real HW connected to a computer.

Sounds useful, but I cannot immediately think how we can do this without requiring someone to manually put the device back to bootloader mode between executions.

@JelmerT JelmerT self-assigned this Oct 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants