summaryrefslogtreecommitdiff
path: root/check
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-09-19 18:01:47 +0300
committerLars Wirzenius <liw@liw.fi>2021-09-19 18:01:47 +0300
commit832658d9326656d81242ef8dda81f577c20914c6 (patch)
tree13a5982c8f46719d7022f9696e934d97753b84f7 /check
parent3badce737414a95836da7a3ebbdf5e86f5d3122a (diff)
downloadclab-832658d9326656d81242ef8dda81f577c20914c6.tar.gz
fix: work with current Subplot, and with user-defined cargo target
Sponsored-by: author
Diffstat (limited to 'check')
-rwxr-xr-xcheck26
1 files changed, 12 insertions, 14 deletions
diff --git a/check b/check
index bc01c0c..aaad3cf 100755
--- a/check
+++ b/check
@@ -5,19 +5,17 @@
set -eu
hideok=chronic
-if [ "$#" -gt 0 ]
-then
- case "$1" in
+if [ "$#" -gt 0 ]; then
+ case "$1" in
verbose | -v | --verbose)
- hideok=
- shift
- ;;
- esac
+ hideok=
+ shift
+ ;;
+ esac
fi
-got_cargo_cmd()
-{
- cargo "$1" --help > /dev/null
+got_cargo_cmd() {
+ cargo "$1" --help >/dev/null
}
got_cargo_cmd clippy && cargo clippy -q --all-targets
@@ -28,13 +26,13 @@ $hideok cargo test
subplot docgen clab.md -o clab.html
subplot docgen clab.md -o clab.pdf
+target="$(cargo metadata --format-version=1 | python3 -c 'import sys, json; o = json.load(sys.stdin); print(o["target_directory"])')"
subplot codegen clab.md -o test.py
rm -f test.log
-if [ "$(id -un)" = root ]
-then
- echo Not running tests as root.
+if [ "$(id -un)" = root ]; then
+ echo Not running tests as root.
else
- $hideok python3 test.py --log test.log "$@"
+ $hideok python3 test.py --log test.log --env "CARGO_TARGET_DIR=$target" "$@"
fi
echo "Everything seems to be in order."