added adaptive quickshell

This commit is contained in:
wt committed 2026-11-17 18:15:16 +07:00
1 parent 6eb56d2065
commit 5b33a73fd8
189 files changed
+8678 -15

No files matched your search

+27
View File
@@ -0,0 +1,27 @@
#!/usr/bin/env python3
"""Real controllers and Process, fake helper only; no production Bluetooth singleton."""
import os
from pathlib import Path
import shutil
import subprocess
import tempfile
root = Path(__file__).resolve().parents[1]
with tempfile.TemporaryDirectory(prefix='adaptive-bluetooth-controller-') as tmp:
runtime = Path(tmp, 'runtime')
runtime.mkdir(mode=0o700)
config = Path(tmp, 'config')
config.mkdir()
shutil.copyfile(root / 'tests/fixtures/bluetooth.qml', config / 'shell.qml')
shutil.copyfile(root / 'tests/bluetooth_fake.py', config / 'bluetooth_fake.py')
for name in ['BluetoothController.qml', 'BluetoothDiscovery.qml']:
shutil.copyfile(root / 'services' / name, config / name)
env = dict(os.environ, QT_QPA_PLATFORM='offscreen', XDG_RUNTIME_DIR=str(runtime),
XDG_STATE_HOME=tmp, XDG_CACHE_HOME=tmp)
result = subprocess.run(['quickshell', '-p', str(config), '--no-color'], env=env,
capture_output=True, text=True, timeout=23)
logs = result.stdout + result.stderr
print(logs)
assert result.returncode == 0 and 'BLUETOOTH_TEST_PASS: 14 scenarios' in logs, logs
for marker in ['BLUETOOTH_TEST_FAIL', 'Failed to load configuration', 'ReferenceError', 'TypeError', 'Binding loop']:
assert marker not in logs, marker