summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-04-17 14:06:10 +0300
committerLars Wirzenius <liw@liw.fi>2021-04-17 15:53:21 +0300
commitf236aef565c1f9c99dcf24979830b232ab6749bc (patch)
tree0d1053ad8ef0b6f7de9a74485b641b81dd85c0c4 /check
parente325fc5e47e5ef34969a30fc6568a58a6026f39b (diff)
downloadclab-f236aef565c1f9c99dcf24979830b232ab6749bc.tar.gz
rewrite in rust
Diffstat (limited to 'check')
-rwxr-xr-xcheck40
1 files changed, 40 insertions, 0 deletions
diff --git a/check b/check
new file mode 100755
index 0000000..bc01c0c
--- /dev/null
+++ b/check
@@ -0,0 +1,40 @@
+#!/bin/sh
+#
+# Run the automated tests for the project.
+
+set -eu
+
+hideok=chronic
+if [ "$#" -gt 0 ]
+then
+ case "$1" in
+ verbose | -v | --verbose)
+ hideok=
+ shift
+ ;;
+ esac
+fi
+
+got_cargo_cmd()
+{
+ cargo "$1" --help > /dev/null
+}
+
+got_cargo_cmd clippy && cargo clippy -q --all-targets
+$hideok cargo build --all-targets
+got_cargo_cmd fmt && $hideok cargo fmt -- --check
+$hideok cargo test
+
+subplot docgen clab.md -o clab.html
+subplot docgen clab.md -o clab.pdf
+
+subplot codegen clab.md -o test.py
+rm -f test.log
+if [ "$(id -un)" = root ]
+then
+ echo Not running tests as root.
+else
+ $hideok python3 test.py --log test.log "$@"
+fi
+
+echo "Everything seems to be in order."