Skip to content
This repository was archived by the owner on Jun 1, 2026. It is now read-only.
This repository was archived by the owner on Jun 1, 2026. It is now read-only.

Add simple test type that allows you to specify when buttons are pressed #8

Open

Description

@virtuald

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.

Activity

  1. sarosenb commented on Dec 17, 2014

    @sarosenb
    Contributor

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

  2. virtuald commented on Dec 17, 2014

    @virtuald
    MemberAuthor

    That would be the time to activate the button.

  3. sarosenb commented on Dec 17, 2014

    @sarosenb
    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 notifications@github.com
    wrote:

    That would be the time to activate the button.

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

  4. virtuald commented on Dec 17, 2014

    @virtuald
    MemberAuthor

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions