mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-11 02:51:10 +00:00
* chore(i18n): translate every missing string in all locales Adds the 87 strings the bottom-screen Dashboard and in-game stats pages introduced to all 32 locales, plus the 51 older settings strings Japanese and the 50 Chinese locales were still missing. Every locale now has all 3456 translatable strings with the same placeholders as English. Also translates 36 entries that were still English where the language does not use the English word, and makes es-419 touch_app_id use the same %1$s placeholder as English. * chore(patches): drop comments from the lines downstream patches add Removes comment lines and trailing comments from lines our patches add, with hunk headers recounted. Lines that a later patch uses as context and the upstream backport 0123 are left as they are. The gamescope, FEX, proot and xodus series still apply to their pinned sources, and the patched trees differ only in those comments. test_hud_frames now finds the HUD writer by its first declaration. * docs: credit Greenlight, Better xCloud, viture-v2, GameNative and DiRTTelemetryErrorFix These were credited only in source headers and NOTICE files. * chore: remove source comments and unused functions Removes explanatory comments from first-party Kotlin, Java, C, C++, Rust, TypeScript, Python, shell, Gradle, CMake and workflow files. License and attribution headers stay, and vendored third-party trees, generated files and license files are untouched. A shellcheck directive is kept, and udevmon's fallthrough comments became fallthrough attributes. Syntax trees and token streams match the previous sources apart from the comments and Python docstrings. Module docstrings that argparse prints are kept, and device-smoke.sh prints the same --help text from a heredoc. Also removes 37 functions and 4 fields that nothing referenced. * chore: remove comments from the Syncthing integration and the latest main sources * docs: credit Syncthing and the syncthing-android fork * chore(i18n): translate the Syncthing strings in all locales The 107 strings the Syncthing integration added are now in all 32 locales. sync_web_path_locked names the Syncthing tab by its label. * docs: credit @xXJSONDeruloXx for the HUD metric readers The CPU, GPU load, thermal and battery readers come from their PerformanceHudView pull requests #777, #877, #991, #1406 and #1573. The FusionHUD credit line is unchanged. * docs: credit the HUD metric readers to @xXJSONDeruloXx's work
64 lines
2.7 KiB
Python
64 lines
2.7 KiB
Python
import os
|
|
from pathlib import Path
|
|
import subprocess
|
|
import tempfile
|
|
import unittest
|
|
|
|
|
|
SESSION = Path(__file__).resolve().parents[1] / 'linuxfs/overlay/usr/local/bin/droiddeck-session'
|
|
|
|
|
|
class SessionPacingTest(unittest.TestCase):
|
|
def launch(self, refresh, **overrides):
|
|
source = SESSION.read_text()
|
|
start = source.index(' width=${BL_WIDTH:-1280}')
|
|
end = source.index('\nfi\n\nbl_displays()', start)
|
|
block = source[start:end].replace('/usr/local/bin/droiddeck-pipewire', 'pipewire_stub')
|
|
with tempfile.TemporaryDirectory() as directory:
|
|
env = dict(os.environ, XDG_RUNTIME_DIR=directory, BL_REFRESH=str(refresh),
|
|
BL_MANGOAPP='0', BL_FPS='0', DROIDDECK_GAME_FRAME_LIMIT='0')
|
|
env.pop('GAMESCOPE_NESTED_REFRESH_FOLLOWS_HOST', None)
|
|
env.update(overrides)
|
|
script = '''
|
|
set -u
|
|
mode=steam
|
|
pipewire_stub() { return 1; }
|
|
run_gamescope() { printf 'ARG:%s\\n' "$@"; printf 'FOLLOW:%s\\n' "${GAMESCOPE_NESTED_REFRESH_FOLLOWS_HOST:-}"; }
|
|
''' + block
|
|
result = subprocess.run(['bash', '-c', script], env=env, capture_output=True,
|
|
text=True, timeout=5)
|
|
self.assertEqual(0, result.returncode, result.stderr)
|
|
self.follow = [line.removeprefix('FOLLOW:') for line in result.stdout.splitlines()
|
|
if line.startswith('FOLLOW:')]
|
|
return [line.removeprefix('ARG:') for line in result.stdout.splitlines()
|
|
if line.startswith('ARG:')]
|
|
|
|
def test_display_refresh_sets_the_nested_compositor_rate(self):
|
|
for refresh in (60, 90, 120):
|
|
with self.subTest(refresh=refresh):
|
|
args = self.launch(refresh)
|
|
self.assertEqual(str(refresh), args[args.index('-r') + 1])
|
|
self.assertIn('-e', args)
|
|
|
|
def test_gamescope_follows_the_panel_after_the_starting_rate(self):
|
|
self.launch(144)
|
|
self.assertEqual(['1'], self.follow)
|
|
self.launch(0)
|
|
self.assertEqual([''], self.follow)
|
|
|
|
def test_retired_cap_variables_do_not_override_the_display_rate(self):
|
|
for performance in ('0', '1'):
|
|
with self.subTest(performance=performance):
|
|
args = self.launch(120, BL_FPS='30', DROIDDECK_GAME_FRAME_LIMIT=performance)
|
|
self.assertEqual('120', args[args.index('-r') + 1])
|
|
self.assertNotIn('--framerate-limit', args)
|
|
|
|
def test_retired_cap_cannot_set_the_rate_when_the_display_rate_is_unknown(self):
|
|
args = self.launch(0, BL_FPS='30', DROIDDECK_GAME_FRAME_LIMIT='1')
|
|
self.assertNotIn('-r', args)
|
|
self.assertNotIn('--framerate-limit', args)
|
|
|
|
|
|
if __name__ == '__main__':
|
|
unittest.main()
|