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 simple test type that allows you to specify when buttons are pressed #8

Open
virtuald opened this issue Dec 17, 2014 · 4 comments

Comments

@virtuald
Copy link
Member

This is the most common type of simplistic test one might want, I imagine. The primary usefulness I think would be exercising all your stuff, so you can be sure that they don't have syntax errors. Adding an additional function that gets called to check it is nice, but should be optional. Something like.. hm. I don't really know what this looks like. Maybe:

# port, button number?
release = (1, 1)
fire = (1,2)

# time, button to press (defaults to pressing for 0.2s)
tests = [
  (1.0, release),
  (2.0, fire),
  .. 
]

run_button_test(tests)

@sarosenb you should do this.

@sarosenb
Copy link
Contributor

I can see the usefulness of this. What is the 1.0 and 2.0 in the test list used for?

@virtuald
Copy link
Member Author

That would be the time to activate the button.

@sarosenb
Copy link
Contributor

I think what you can do is, if you want to assert something at the end of a
test you could have something like this:

port, button number?

release = (1, 1)
fire = (1,2)

time, button to press (defaults to pressing for 0.2s),

(optional)lamda to be run at end #of test

tests = [
(1.0, release, lamda:assert(hal_data['pwm'][0]['val'] = 1),
(2.0, fire),
..
]

On Wed, Dec 17, 2014 at 11:19 AM, Dustin Spicuzza [email protected]
wrote:

That would be the time to activate the button.


Reply to this email directly or view it on GitHub
#8 (comment).

@virtuald
Copy link
Member Author

yeah, the lambda thing was what I was thinking too.

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

No branches or pull requests

2 participants