summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-11-14 16:27:21 +0200
committerLars Wirzenius <liw@liw.fi>2020-11-14 16:27:21 +0200
commitc6b36078f7fc4f1f76b31745e1bc3e6b35450c12 (patch)
tree8ec12e5f6f5e7c56ff2b50d7c6707030815160bf
parentf47db1bd16c0e7c7d4f97e5a135b5034f059e85f (diff)
downloadjt2-c6b36078f7fc4f1f76b31745e1bc3e6b35450c12.tar.gz
test: make ./check clearer by making it less generic
-rwxr-xr-xcheck39
1 files changed, 9 insertions, 30 deletions
diff --git a/check b/check
index 753de3d..f9d68e1 100755
--- a/check
+++ b/check
@@ -24,40 +24,19 @@ then
hideok=
fi
-
-codegen() {
- $hideok sp-codegen "$1" --output "$2" --run
-}
-
-docgen() {
- $hideok sp-docgen "$1" --output "$2"
-}
-
+$hideok cargo check --all-targets
+$hideok cargo clippy
$hideok cargo build --all-targets
-if cargo --list | awk '{ print $1 }' | grep 'clippy$' > /dev/null
-then
- $hideok cargo clippy
-fi
$hideok cargo test
-if command -v rustfmt > /dev/null
-then
- find src -type f -name '*.rs' -exec rustfmt --check '{}' +
-fi
+$hideok cargo fmt -- --check
+$hideok find . -type f -name '*.py' ! -name test.py -exec black --check '{}' +
-if command -v black > /dev/null
-then
- $hideok find . -type f -name '*.py' ! -name template.py ! -name test.py \
- -exec black --check '{}' +
-fi
+$hideok sp-docgen jt.md --output jt.html
+$hideok sp-docgen jt.md --output jt.pdf
-for md in [^CR]*.md
-do
- $hideok echo "$md ====================================="
- codegen "$md" test.py
- docgen "$md" "$(basename "$md" .md).pdf"
- docgen "$md" "$(basename "$md" .md).html"
- $hideok echo
-done
+$hideok sp-codegen jt.md --output test.py
+rm -f test.log
+$hideok python3 test.py --log test.log "$@"
echo "Everything seems to be in order."