test.sh: add rust/cargo runner

This commit is contained in:
Xiretza 2021-12-01 09:18:38 +01:00
parent 3b768f045c
commit ba84afae67

10
test.sh
View file

@ -8,9 +8,13 @@ YEAR=2020
run_solution() {
if [ -d "$solution" ]; then
runfile=$solution/run.sh
[ -f "$runfile" ] || { echo "Error: $runfile not found" >&2; exit 1; }
"$runfile" "$input"
if [ -f "$solution/Cargo.toml" ]; then
cargo run --quiet --manifest-path "$solution/Cargo.toml" < "$input"
else
runfile=$solution/run.sh
[ -f "$runfile" ] || { echo "Error: $runfile not found" >&2; exit 1; }
"$runfile" "$input"
fi
else
case "$(basename "$solution")" in
*.hs)