diff options
-rwxr-xr-x | check | 38 |
1 files changed, 16 insertions, 22 deletions
@@ -228,15 +228,25 @@ def check_rust(r, strict=False): """Run all checks for Rust code""" r.title("checking Rust code") - r.runcmd(["cargo", "build", "--all-targets"]) + r.runcmd(["cargo", "build", "--workspace", "--all-targets"]) + if r.got_cargo("clippy"): + argv = [ + "cargo", + "clippy", + "--workspace", + "--all-targets", + ] if strict: - r.runcmd(["cargo", "clippy", "--all-targets", "--", "-D", "warnings"]) - else: - r.runcmd(["cargo", "clippy", "--all-targets"]) + argv += [ + "--", + "-Dwarnings", + ] + r.runcmd(argv) elif strict: sys.exit("Strict Rust checks specified, but clippy was not found") - r.runcmd(["cargo", "test"]) + + r.runcmd(["cargo", "test", "--workspace"]) r.runcmd(["cargo", "fmt", "--", "--check"]) @@ -308,20 +318,6 @@ def tail(filename, numlines=100): print(f" {line.rstrip()}") -def check_subplotlib(r): - """Run all checks for subplotlib""" - r.title("checking subplotlib code") - - output = os.path.abspath("test-outputs/subplotlib") - os.makedirs(output, exist_ok=True) - - # Run Rust tests for the subplotlib library. - r.runcmd(["cargo", "test", "--lib"], cwd="subplotlib") - - # Run Rust doctests for the subplotlib library. - r.runcmd(["cargo", "test", "--doc"], cwd="subplotlib") - - def check_tooling(r): """Check build environment for tooling the test suite needs""" commands = [ @@ -361,7 +357,7 @@ def parse_args(): "--strict", action="store_true", help="don't allow compiler warnings" ) - all_whats = ["tooling", "python", "shell", "rust", "subplots", "subplotlib"] + all_whats = ["tooling", "python", "shell", "rust", "subplots"] p.add_argument( "what", nargs="*", default=all_whats, help=f"what to test: {all_whats}" ) @@ -394,8 +390,6 @@ def main(): check_rust(r, strict=args.strict) elif what == "subplots": check_subplots(r) - elif what == "subplotlib": - check_subplotlib(r) elif what == "tooling": check_tooling(r) else: |