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