Skip to content

Commit ebf76a1

Browse files
authored
tests(feat[ghostty]): Add libghostty-vt 1.0 oracle (#53)
why: Import-time coverage missed module-top statements during pytest11 plugin discovery, and differential fuzzing needed an active-viewport ctypes oracle against libghostty-vt 1.0. what: - Trace module-top definitions via coverage run --branch --source=libvt -m pytest + combine in justfile and CI, and enforce codec Mode/OSC parity in tests/test_codec.py - Add tests/_ghostty_vt.py ctypes wrapper and tests/test_differential_ghostty.py prefix-determinism and viewport checks
2 parents a64bf74 + bc4d20b commit ebf76a1

6 files changed

Lines changed: 818 additions & 1 deletion

File tree

‎.github/workflows/tests.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,14 @@ jobs:
3636
- name: Type check (ty)
3737
run: uv run ty check --output-format github
3838
- name: Tests (pytest)
39+
if: matrix.python-version != '3.14'
3940
run: uv run pytest -m ""
41+
- name: Tests + Branch Coverage (coverage run -m pytest)
42+
if: matrix.python-version == '3.14'
43+
run: |
44+
uv run python -m coverage run --branch --source=libvt -m pytest -m ""
45+
uv run python -m coverage combine
46+
uv run python -m coverage report
4047
4148
test-macos:
4249
runs-on: macos-latest

‎justfile‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ default:
1616
test *args:
1717
uv run pytest {{ args }}
1818

19+
# Run tests under branch coverage (traces before pytest11 imports libvt)
20+
[group: 'test']
21+
cov *args:
22+
uv run python -m coverage erase
23+
uv run python -m coverage run --branch --source=libvt -m pytest {{ args }}
24+
uv run python -m coverage combine
25+
uv run python -m coverage report
26+
1927
# Run tests then start continuous testing with pytest-watcher
2028
[group: 'test']
2129
start:

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,4 +270,5 @@ asyncio_default_fixture_loop_scope = "function"
270270
xfail_strict = true
271271
markers = [
272272
"integration: integration tests (require optional system utilities)",
273+
"ghostty: differential tests against compiled libghostty-vt 1.0 shared library",
273274
]

0 commit comments

Comments
 (0)