Initial working version
This commit is contained in:
commit
ec1c5958ce
33 changed files with 4547 additions and 0 deletions
34
tests/test_controller.py
Normal file
34
tests/test_controller.py
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
import traceback
|
||||
import sys
|
||||
import os
|
||||
|
||||
print("Starting controller test...")
|
||||
|
||||
try:
|
||||
import sdl2
|
||||
print("SDL2 imported successfully")
|
||||
except ImportError as e:
|
||||
print(f"Failed to import SDL2: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
from src.game.input.gamepad import VirtualController
|
||||
print("Controller support module imported successfully")
|
||||
except Exception as e:
|
||||
print(f"Failed to import controller support module: {e}")
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
print("Creating VirtualController...")
|
||||
controller = VirtualController()
|
||||
print("VirtualController created successfully")
|
||||
|
||||
print(f"Controller available: {controller.is_available()}")
|
||||
print(f"Physical controller available: {controller.is_physical_controller_available()}")
|
||||
|
||||
print("Test completed successfully!")
|
||||
except Exception as e:
|
||||
print(f"Error during testing: {e}")
|
||||
traceback.print_exc()
|
||||
sys.exit(1)
|
||||
Loading…
Add table
Add a link
Reference in a new issue