summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
Diffstat (limited to 'check')
-rwxr-xr-xcheck39
1 files changed, 38 insertions, 1 deletions
diff --git a/check b/check
index d1edc07..12196a5 100755
--- a/check
+++ b/check
@@ -162,6 +162,21 @@ class Runcmd:
**kwargs,
)
+ def libdocgen(self, bindings, output):
+ self.cargo(
+ [
+ "run",
+ "--package=subplot",
+ "--bin=subplot",
+ "--",
+ f"--resources={os.path.abspath('share')}",
+ "libdocgen",
+ "--output",
+ output,
+ bindings,
+ ]
+ )
+
def get_templates(self, filename):
metadata = self.cargo(
[
@@ -358,6 +373,26 @@ def check_tooling(r):
)
+def check_doc(r):
+ docs = os.path.join("test-outputs", "libdocs")
+ if not os.path.exists(docs):
+ os.mkdir(docs)
+
+ bindings = []
+ for dirname, _, basenames in os.walk("share"):
+ dirname = dirname[len("share/") :]
+ bindings += [
+ os.path.join(dirname, x)
+ for x in basenames
+ if x != "template.yaml" and x.endswith(".yaml")
+ ]
+
+ for filename in bindings:
+ md = os.path.splitext(os.path.basename(filename))[0] + ".md"
+ md = os.path.join(docs, md)
+ r.libdocgen(filename, md)
+
+
def parse_args():
"""Parse command line arguments to this script"""
p = argparse.ArgumentParser()
@@ -375,7 +410,7 @@ def parse_args():
"--offline", action="store_true", help="only run tests that can be run offline"
)
- all_whats = ["tooling", "python", "shell", "rust", "subplots"]
+ all_whats = ["tooling", "python", "shell", "rust", "subplots", "doc"]
p.add_argument(
"what", nargs="*", default=all_whats, help=f"what to test: {all_whats}"
)
@@ -410,6 +445,8 @@ def main():
check_subplots(r)
elif what == "tooling":
check_tooling(r)
+ elif what == "doc":
+ check_doc(r)
else:
sys.exit(f"Unknown test {what}")