summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-07-16 10:59:01 +0300
committerLars Wirzenius <liw@liw.fi>2021-07-16 11:15:53 +0300
commit47fd32180b160b0380b5b62c7c026089f2c831e3 (patch)
tree791af62d9b70d404ae9bd6392a0f2576f5122c07 /check
parent3ceeb89490343bd1abac45df5745c88ce9f2853f (diff)
downloadobnam2-47fd32180b160b0380b5b62c7c026089f2c831e3.tar.gz
test: have ./check verify all needed tools are installed
Sponsored-by: author
Diffstat (limited to 'check')
-rwxr-xr-xcheck23
1 files changed, 23 insertions, 0 deletions
diff --git a/check b/check
index ba187fc..8ff40c1 100755
--- a/check
+++ b/check
@@ -15,11 +15,34 @@ then
esac
fi
+require_cmd()
+{
+ if ! command -v "$1" > /dev/null
+ then
+ echo "Need to have $1 installed, but can't find it" 1>&2
+ return 1
+ fi
+}
+
got_cargo_cmd()
{
cargo "$1" --help > /dev/null
}
+require_cmd rustc
+require_cmd cc
+require_cmd cargo
+require_cmd python3
+require_cmd subplot
+require_cmd summain
+require_cmd chronic
+require_cmd pkg-config
+require_cmd pandoc
+require_cmd pdflatex
+
+# daemonize installation location changed from Debian 10 to 11.
+require_cmd daemonize || require_cmd /usr/sbin/daemonize
+
got_cargo_cmd clippy && cargo clippy --all-targets -q
$hideok cargo build --all-targets
got_cargo_cmd fmt && $hideok cargo fmt -- --check