From 2190bf988f28bf8ebcbc63bc8b6ea48783458a50 Mon Sep 17 00:00:00 2001 From: bobcatchris <83428450+bobcatchris@users.noreply.github.com> Date: Tue, 1 Dec 2026 13:56:28 -0600 Subject: [PATCH] tests: verify tracked d3d12/docs/switches.md matches d3d12_switches.py --check --- tests/test_d3d12_switches.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tests/test_d3d12_switches.py b/tests/test_d3d12_switches.py index 85b95e5aef..425fa4fd2b 100644 --- a/tests/test_d3d12_switches.py +++ b/tests/test_d3d12_switches.py @@ -2,7 +2,7 @@ python -I tests/test_d3d12_switches.py -Sources written by hand here; the last test runs on the repository's own. No build, no GPU, no game files. +Sources written by hand here; CommandTest runs on the repository's own. No build, no GPU, no game files. """ import contextlib import io @@ -171,6 +171,20 @@ def test_the_repository_is_listed_and_an_unwritable_path_is_one_line(self): # A moved folder must not turn the list into an empty one. self.assertGreater(data.count(b"| `LEONIDA_"), 300) + def test_the_tracked_switches_page_matches_the_sources(self): + switches = os.path.join(ROOT, "d3d12", "docs", "switches.md") + out, err = io.StringIO(), io.StringIO() + with contextlib.redirect_stdout(out), contextlib.redirect_stderr(err): + code = ds.main(["--root", ROOT, "--check", switches]) + self.assertEqual( + code, + 0, + "d3d12/docs/switches.md is out of date (regenerate with " + "`python -I tools/d3d12_switches.py --out d3d12/docs/switches.md`):\n" + + out.getvalue() + + err.getvalue(), + ) + if __name__ == "__main__": unittest.main()