summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-09-17 08:09:49 +0300
committerLars Wirzenius <liw@liw.fi>2020-09-17 08:09:49 +0300
commitde64a2fe2482d4c6c31ce7c632edf422f32e68b1 (patch)
treee4fd1bc35cfe0b36a3ab840d7f40f893032f3f50 /check
parent266b00a00a6a245464b6a4918f98ea55fcba286b (diff)
downloadobnam2-de64a2fe2482d4c6c31ce7c632edf422f32e68b1.tar.gz
test: add script to run automated tests
Diffstat (limited to 'check')
-rwxr-xr-xcheck28
1 files changed, 28 insertions, 0 deletions
diff --git a/check b/check
new file mode 100755
index 0000000..29032dc
--- /dev/null
+++ b/check
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Run the automated tests for the project.
+
+set -eu
+
+quiet=-q
+hideok=chronic
+if [ "$#" -gt 0 ]
+then
+ case "$1" in
+ verbose | -v | --verbose)
+ quiet=
+ hideok=
+ ;;
+ esac
+fi
+
+cargo build --all-targets $quiet
+cargo clippy $quiet
+$hideok cargo test $quiet
+
+if command -v rustfmt > /dev/null
+then
+ find src -type f -name '*.rs' -exec rustfmt --check '{}' +
+fi
+
+echo "Everything seems to be in order."