Очистить проект от сборок и отчётов, оставить README на русском
This commit is contained in:
1 parent
ee5f6f580e
commit
ce9fe1bb03
42 files changed
+146
-2529
No files matched your search
+13
-6
@@ -1,5 +1,6 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Exercise the actual Qt binaries in isolated, explicit offscreen DEMO projects."""
|
||||
"""Проверка GUI при трёх масштабах в отдельных синтетических проектах без экрана."""
|
||||
import argparse
|
||||
import datetime
|
||||
import json
|
||||
import os
|
||||
@@ -9,7 +10,13 @@ import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
root = Path(__file__).resolve().parents[1]
|
||||
output = root/'artifacts/screenshots'
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('--build-dir', type=Path, default=Path('build-astra'), help='Каталог готовой сборки')
|
||||
parser.add_argument('--output-dir', type=Path, default=Path('artifacts/gui'), help='Каталог скриншотов и отчёта')
|
||||
args = parser.parse_args()
|
||||
build = (root/args.build_dir).resolve()
|
||||
output = (root/args.output_dir).resolve()
|
||||
os.umask(0o077)
|
||||
output.mkdir(parents=True, exist_ok=True)
|
||||
records = []
|
||||
|
||||
@@ -19,7 +26,7 @@ for scale in ('1', '1.5', '2'):
|
||||
environment.update(QT_QPA_PLATFORM='offscreen', QT_SCALE_FACTOR=scale,
|
||||
XDG_CONFIG_HOME=temporary+'/preferences')
|
||||
screenshot = output/('overview-'+scale+'.png')
|
||||
argv = [str(root/'build/ald-transition-console'), '--project', temporary+'/project',
|
||||
argv = [str(build/'ald-transition-console'), '--project', temporary+'/project',
|
||||
'--demo', '--smoke-test', '--capture', str(screenshot)]
|
||||
result = subprocess.run(argv, env=environment, capture_output=True, text=True, timeout=20)
|
||||
records.append(dict(kind='application_demo', scale=scale, exit_code=result.returncode,
|
||||
@@ -28,7 +35,7 @@ for scale in ('1', '1.5', '2'):
|
||||
expected = (int(1440*float(scale)), int(900*float(scale)))
|
||||
assert struct.unpack('>II', screenshot.read_bytes()[16:24]) == expected
|
||||
environment['ALD_TEST_CAPTURE_DIR'] = str(output/('scale-'+scale))
|
||||
result = subprocess.run([str(root/'build/test_ui')], env=environment,
|
||||
result = subprocess.run([str(build/'test_ui')], env=environment,
|
||||
capture_output=True, text=True, timeout=30)
|
||||
records.append(dict(kind='ui_suite', scale=scale, exit_code=result.returncode,
|
||||
stdout=result.stdout, stderr=result.stderr))
|
||||
@@ -37,9 +44,9 @@ for scale in ('1', '1.5', '2'):
|
||||
image = output/('scale-'+scale)/f'narrow-{page:02d}.png'
|
||||
expected = (int(1024*float(scale)), int(768*float(scale)))
|
||||
assert struct.unpack('>II', image.read_bytes()[16:24]) == expected
|
||||
print(f'PASS: actual Qt DEMO + 10 narrow pages, scale {scale}', flush=True)
|
||||
print(f'Пройдено: GUI в режиме DEMO и 10 страниц в узком окне, масштаб {scale}', flush=True)
|
||||
|
||||
report = dict(observed_at=datetime.datetime.now(datetime.timezone.utc).isoformat(),
|
||||
platform='Qt offscreen', records=records, astra_validated=False,
|
||||
x11_desktop_validated=False, screen_reader_validated=False)
|
||||
(root/'docs/gui-smoke-results.json').write_text(json.dumps(report, ensure_ascii=False, indent=2)+'\n')
|
||||
(output/'result.json').write_text(json.dumps(report, ensure_ascii=False, indent=2)+'\n', encoding='utf-8')
|
||||
Reference in new issue
Block a user