summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-11-27 17:05:58 +0200
committerLars Wirzenius <liw@liw.fi>2021-11-27 17:05:58 +0200
commit6d999887fee445ca3598a548b13ec6bc741bf34e (patch)
treee4765b1a0e7d246881f669e7fe58efe339e4bb52 /check
parente79cc01fb51b23b64b75dd09831989a41ea4f7d3 (diff)
downloadsubplot-6d999887fee445ca3598a548b13ec6bc741bf34e.tar.gz
refactor: ./check runs cargo build/test/etc, for the whole workspace
Drop the "subplotlib" as a "what" possibility for ./check, as it's not needed anymore. Sponsored-by: author
Diffstat (limited to 'check')
-rwxr-xr-xcheck38
1 files changed, 16 insertions, 22 deletions
diff --git a/check b/check
index b1796c7..ac19c5f 100755
--- a/check
+++ b/check
@@ -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: