ws-docs: tools/docs_check.py (guide snippets and examples become tests under both runtimes), docs inputs generator

This commit is contained in:
4DBug committed 2026-10-31 13:05:43 -05:00
1 parent 9941113b7b
commit cdcbd76b9e
4 files changed
+362

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
# Docs snippets (tools/fixtures.py): every ```luau block of docs/guide/*.md and every examples/*.luau becomes a test
# under tests/docs/snippets/ (tools/docs_check.py explains the markers). Generated here so `bash tools/test.sh`
# always tests the pages as they are; the inputs the snippets read come from tools/fixtures/docs_*.py.
import importlib.util, os
INPUTS = ["docs/guide", "examples", "tools/docs_check.py"]
def generate(ctx):
spec = importlib.util.spec_from_file_location("docs_check", os.path.join(ctx.root, "tools", "docs_check.py"))
dc = importlib.util.module_from_spec(spec)
spec.loader.exec_module(dc)
paths, nrun, nshow, nex = dc.generate()
print("fixtures: docs: %d snippets to run, %d display-only, %d examples" % (nrun, nshow, nex))
ctx.outputs.extend(paths)