summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-05-02 09:21:49 +0300
committerLars Wirzenius <liw@liw.fi>2020-05-02 14:26:04 +0300
commitd9e1fa5cf7db06f3ef0a255d533f45900627b307 (patch)
tree3dbecfc68a7689819e9a4cd944023a36f2cc2d7a /check
parent110c64741d4a674a245515444036de9a64e828c0 (diff)
downloadsubplot-d9e1fa5cf7db06f3ef0a255d533f45900627b307.tar.gz
Change: ./check to be quiet by default
I got tired of ./check output being verbose, so this changes it to be silent unless there's a problem. An argument of -v or --verbose or verbose makes it verbose again.
Diffstat (limited to 'check')
-rwxr-xr-xcheck37
1 files changed, 30 insertions, 7 deletions
diff --git a/check b/check
index 8330c2b..073b6ee 100755
--- a/check
+++ b/check
@@ -2,21 +2,44 @@
set -eu
+verbose=false
+if [ "$#" -gt 0 ]
+then
+ case "$1" in
+ verbose | -v | --verbose)
+ verbose=true
+ ;;
+ esac
+fi
+
+hideok=
+if command -v chronic > /dev/null
+then
+ hideok=chronic
+fi
+quiet=-q
+if $verbose
+then
+ quiet=
+ hideok=
+fi
+
+
codegen() {
- cargo run -q --bin sp-codegen -- "$1" --output "$2" --run \
+ $hideok cargo run $quiet --bin sp-codegen -- "$1" --output "$2" --run \
--templates "$(pwd)/templates"
}
docgen() {
- cargo run -q --bin sp-docgen -- "$1" --output "$2"
+ cargo run $quiet --bin sp-docgen -- "$1" --output "$2"
}
-cargo build --all-targets
+$hideok cargo build --all-targets
if cargo --list | awk '{ print $1 }' | grep 'clippy$' > /dev/null
then
- cargo clippy
+ cargo clippy $quiet
fi
-cargo test
+$hideok cargo test $quiet
if command -v rustfmt > /dev/null
then
@@ -25,11 +48,11 @@ fi
for md in [^R]*.md
do
- echo "$md ====================================="
+ $hideok echo "$md ====================================="
codegen "$md" test.py
docgen "$md" "$(basename "$md" .md).pdf"
docgen "$md" "$(basename "$md" .md).html"
- echo
+ $hideok echo
done
echo "Everything seems to be in order."