diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-04-17 14:06:10 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-04-17 15:53:21 +0300 |
commit | f236aef565c1f9c99dcf24979830b232ab6749bc (patch) | |
tree | 0d1053ad8ef0b6f7de9a74485b641b81dd85c0c4 /check | |
parent | e325fc5e47e5ef34969a30fc6568a58a6026f39b (diff) | |
download | clab-f236aef565c1f9c99dcf24979830b232ab6749bc.tar.gz |
rewrite in rust
Diffstat (limited to 'check')
-rwxr-xr-x | check | 40 |
1 files changed, 40 insertions, 0 deletions
@@ -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." |