Files
not-python-rust/runtests.sh
Alek Ratzloff 0a21f01ea7 Add RUSTFLAGS=-Awarnings to runtests.sh
If there are warnings in the crate build, we should avoid them while
running each individual test, otherwise we get nonstop warnings.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2024-09-30 16:32:52 -07:00

32 lines
609 B
Bash
Executable File

#!/bin/bash
function die() {
local msg
msg="$1"
echo "$msg - exiting"
exit 1
}
here="$(realpath "$(dirname "$0")")"
tests="$here/tests"
flags="--quiet --release"
# Disable warnings while running tests
export RUSTFLAGS=-Awarnings
echo "building"
cargo build $flags || die "build failed"
echo "testing"
find "$tests" -type f -name '*.npp' | while read f; do
result="$(cargo run $flags -- "$f")"
echo "$result" > "$f.got"
if [[ "$result" != "$(cat "$f.expect")" ]]; then
echo "$f did not match expected output"
diff "$f.got" "$f.expect"
fi
done
echo "done"