Skip to content

Add interactive tests for joystick module. (1916) #1042

Open
@GalacticEmperor1

Description

@GalacticEmperor1

Issue №1916 opened by MyreMylar at 2020-06-04 18:34:30

For large parts of the joystick module functionality, the CI won't give much useful coverage because there won't be a controller plugged in.

To bridge this gap we'll need to create a set of interactive tests that ask you to plug in a cotnroller (if you don't have one already inserted) and then work a bit like the interactive font tests seen here testing button pressing, analog stick waggling and what happens when you quit the module with an active controller:

https://github.com/pygame/pygame/blob/a975f079ee74d2fae892835c09e05bf25f3df6fc/test/font_test.py# L475-L561


Comments

# # khuang0312 commented at 2020-06-07 19:20:05

Since I also commented on # 1780, may I also be assigned to this issue as well?


# # MyreMylar commented at 2020-06-07 20:02:37

Absolutely.


# # khuang0312 commented at 2020-06-25 15:05:30

@MyreMylar You know anyone who has tried using a trackball as a Pygame joystick? In the documentation, it says that a trackball can be used as a joystick. So far, I have no success with my Logitech Trackman marble.

My PS3 controller does work though.


# # MyreMylar commented at 2020-06-25 18:15:19

@khuang0312 It may depend on whether your specific model of trackball is supported by SDL as a joystick. From what I have seen the way the system works for the joystick module is a giant look up table of manufacturer and model IDs, that then pushes a controller down a specific code path. If your controller's ID is not in the database it just makes a guess/picks a default which often works badly. I believe it's not too hard to add new controllers but someone has to manually do it as manufacturers create them. We get the same issue a lot with steering wheel controllers.

There is a new controller module in SDL2 separate from the joystick module which may work differently in that regard (or probably exactly the same knowing our luck).


# # khuang0312 commented at 2020-08-01 10:40:43

Should I test other functions within joystick besides the ones with existing test stubs?

Also, my current method of interactivity relies on text input but I don't know if that is kosher.

@MyreMylar


# # Shikharishere commented at 2022-10-28 14:23:40

Hey, @MyreMylar is this issue open for contribution?


# # MyreMylar commented at 2022-10-28 14:28:31

As far as I know nobody is tackling it at the moment, so you are welcome to.

You might want to check the current state of the joystick tests as it's
been a minute since I last ran them.

On Fri, 28 Oct 2022, 15:23 Shikhar Upadhyay, @.***>
wrote:

Hey, @MyreMylar https://github.com/MyreMylar is this issue open for
contribution?


Reply to this email directly, view it on GitHub
<pygame/pygame#1916 issuecomment-1295065354>,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/ADGDGGR3WFXT4GI6NRUUOBDWFPOXNANCNFSM4NS4FNDQ
.
You are receiving this because you were mentioned.Message ID:
@.***>


# # Shikharishere commented at 2022-10-29 05:59:58

Great!! I will check that! Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions