summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-11-27 09:17:58 +0200
committerLars Wirzenius <liw@liw.fi>2021-11-27 14:10:35 +0200
commit99c0d2c80a476e13866cbd74b6e35ff95a1e5d58 (patch)
tree62249bc5c5a3b6a47bffc723dc21849f8f83689f /check
parente3a8468282771369b5fb37be5c6e23c1e2833433 (diff)
downloadsubplot-99c0d2c80a476e13866cbd74b6e35ff95a1e5d58.tar.gz
refactor: use build.rs for testing subplotlib subplots
A bit of dog-fooding: use subplot-build to test subplotlib. Add a subplotlib/build.rs script to generate test code in Rust for the subplotlib/*.md subplots. The generated code is included in tests/*.rs, and run with "cargo test". Drop the same functionality from the ./check script.. Sponsored-by: author
Diffstat (limited to 'check')
-rwxr-xr-xcheck21
1 files changed, 0 insertions, 21 deletions
diff --git a/check b/check
index 1320fad..b1796c7 100755
--- a/check
+++ b/check
@@ -321,27 +321,6 @@ def check_subplotlib(r):
# Run Rust doctests for the subplotlib library.
r.runcmd(["cargo", "test", "--doc"], cwd="subplotlib")
- # Find subplots for subplotlib.
- mds = find_files("subplotlib/*.md", lambda f: True)
-
- os.makedirs("subplotlib/tests", exist_ok=True)
- for md0 in mds:
- r.title(f"checking subplot {md0}")
- dirname = os.path.dirname(md0)
- md = os.path.basename(md0)
- base, _ = os.path.splitext(md)
- test_rs = os.path.join("tests", base + ".rs")
- r.codegen(md, test_rs, cwd=dirname)
- r.docgen(md, os.path.join(output, base + ".html"), cwd=dirname)
- r.docgen(md, os.path.join(output, base + ".pdf"), cwd=dirname)
-
- # Format the code once more to keep things clean
- r.title("Formatting subplotlib")
- r.cargo(["fmt", "-p", "subplotlib"], cwd=dirname)
- # Run all of the integration suites (many of which have come from the above)
- r.title("Running subplotlib integration tests")
- r.cargo(["test", "-p", "subplotlib", "--tests"])
-
def check_tooling(r):
"""Check build environment for tooling the test suite needs"""