Added Glitch Room Source code to Gitty

This commit is contained in:
Jeff Luke committed 2026-10-04 11:31:17 -07:00
commit 1ac9eb5644
505 files changed
+28504

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
"""Run with the Godot console executable as the first argument. No physical GPIO."""
import subprocess
import sys
import threading
from pathlib import Path
from http.server import HTTPServer
from test_bridge import FakePin, bridge
outputs = bridge.Outputs(FakePin, "cabinet_01_gpio", [17])
server = HTTPServer(("127.0.0.1", 8765), bridge.handler_for(outputs))
thread = threading.Thread(target=server.serve_forever, daemon=True)
thread.start()
try:
root = Path(__file__).resolve().parents[2]
result = subprocess.run([
sys.argv[1], "--headless", "--path", str(root),
"--log-file", str(root / ".godot/gpio_integration.log"),
"--script", "tests/gpio/check_gpio.gd", "--", "--gpio=real",
], timeout=15)
assert result.returncode == 0, "Godot integration failed"
assert 17 in outputs.pins, "Bridge never received BCM17"
assert outputs.pins[17]["polarity"] is True, "Expected active-high output"
print("Godot -> HTTP -> GPIO backend integration passed (fake pin)")
finally:
server.shutdown()
thread.join()
outputs.close()
server.server_close()