test(pad): ignore host controllers in the pad tests #28817
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/28817"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-12-03T23:42:05Z.
What
pad_sdland the fourpad_identify_*tests assume SDL sees no host controllers: they return 77 whenSDL_NumJoysticks()is above zero, and otherwise attach their own virtual controllers and expect them in the first pad slots. A real controller changes the result:pad_sdl).pad_sdlconnects the two real controllers in slots 0 and 1 and then hangs; the identify tests print nothing before the kill. The same main passes on a host without controllers.The five tests now run with
SDL_JOYSTICK_HIDAPI,SDL_JOYSTICK_RAWINPUT,SDL_JOYSTICK_WGI,SDL_XINPUT_ENABLEDandSDL_DIRECTINPUT_ENABLEDset to 0, andSDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT=0xFFFF/0xFFFFso every real device is ignored while the tests' virtual controllers are not. It is set in the tests' ctestENVIRONMENTonly; nothing changes at runtime for users, and what each test checks is unchanged.Tested
Linux x86_64, GCC, Release,
BUILD_TESTING=ON, on a host with live evdev input devices, main5ff6ec4.ctest -R '^(pad_identify_(connect|invalid|off|rumble)|pad_sdl)$'skips all five ("SDL sees 1 host joysticks").pad_sdl5.3 s, the identify tests 3.1 s, 3.1 s, 3.1 s and 0.08 s).Not tested on Windows with a controller attached: the hang was seen on the Windows lane, and whether these five variables remove it there still has to be confirmed by running the same ctest regex on a Windows host with a controller plugged in.
Checklist
main; no other open PR implements the same functions.mdfiles or images added to the repositorySummary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by JJenkx on 2026-12-03T23:45:49Z.
Review: COMMENTED
I checked
d0fc267ef6d8with a Linux probe linked to the pinned SDL274be4c2836da. SDL checks its Steam Virtual Gamepad exception beforeSDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT. With this PR's environment and an inheritedSDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD=1, the probe ignored a regular Xbox controller ID but accepted the Steam Input virtual controller ID. With the Steam hint set to0, it ignored both. Pinned SDL checkCould you add
SDL_GAMECONTROLLER_ALLOW_STEAM_VIRTUAL_GAMEPAD=0topadTestSdlEnvironment? A separate probe with host input devices hidden confirmed thatSDL_JoystickAttachVirtualExstill adds a recognized controller with the hint off, as the test fixtures require. The filter probe used synthetic device IDs. Windows with physical controllers remains unverified here.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-04T01:45:12Z.
Review: APPROVED
Reviewed — looks good
The CTest environment is scoped to the five pad tests, and their existing skip behavior and Windows PATH settings remain in place.
What I ran
Reviewed head
d0fc267ef6d8581473ab649a85e7946daa0d15eb; basemain(fc5e1cfdfedb018a3c3e7ae9afdde4dcd6a1ae3c). No merged-preview check, build, or test was run.Results
Negative control
Not run; no tests were run in this review.
Findings
Blocking
None.
Non-blocking
None.
Sources
Not verified
The Windows behavior with a controller attached was not run. The Linux test results in the PR description are author-reported, not run in this review. Read the review description, commit list, manifest, diff, and targeted ranges of
CMakeLists.txt,PadSdl.cpp, andPadIdentify.cpp. The manifest lists one reviewed changed file,core/libs/prx/libSceVideoOut/CMakeLists.txt; no files were excluded.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by Plyxen on 2026-12-04T13:51:13Z.
Review: APPROVED
Verified on Windows 11 (GCC 15.2, Release) on main
484b0368d3. Applied together with #28892, #28891, #28890 and #27995, which touch separate files.pad_sdlandpad_identify_connect,_off,_rumbleand_invalidpassed in 3 of 3 runs with the new environment. None skipped, so the virtual controller the tests attach is still seen underSDL_GAMECONTROLLER_IGNORE_DEVICES_EXCEPT=0xFFFF/0xFFFF.ENVIRONMENTvalue next to the WindowsENVIRONMENT_MODIFICATIONPATH entries.Not run: a host with a physical controller connected, which is the case this fixes, and Linux.
AI-assisted: yes (Claude Code)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.