diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-11-27 09:17:58 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-11-27 14:10:35 +0200 |
commit | 99c0d2c80a476e13866cbd74b6e35ff95a1e5d58 (patch) | |
tree | 62249bc5c5a3b6a47bffc723dc21849f8f83689f /check | |
parent | e3a8468282771369b5fb37be5c6e23c1e2833433 (diff) | |
download | subplot-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-x | check | 21 |
1 files changed, 0 insertions, 21 deletions
@@ -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""" |