test.sh: add rust/cargo runner

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

View file

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