mirror of
https://github.com/ProjectLeonida/mandy.git
synced 2026-12-06 09:18:37 +00:00
tests: verify tracked d3d12/docs/switches.md matches d3d12_switches.py --check
This commit is contained in:
@ -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 @@ class CommandTest(unittest.TestCase):
|
||||
# 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()
|
||||
|
||||
Reference in New Issue
Block a user