diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-09-19 18:01:47 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-09-19 18:01:47 +0300 |
commit | 832658d9326656d81242ef8dda81f577c20914c6 (patch) | |
tree | 13a5982c8f46719d7022f9696e934d97753b84f7 /check | |
parent | 3badce737414a95836da7a3ebbdf5e86f5d3122a (diff) | |
download | clab-832658d9326656d81242ef8dda81f577c20914c6.tar.gz |
fix: work with current Subplot, and with user-defined cargo target
Sponsored-by: author
Diffstat (limited to 'check')
-rwxr-xr-x | check | 26 |
1 files changed, 12 insertions, 14 deletions
@@ -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." |