diff --git a/test.sh b/test.sh index cfc1817..55ad108 100755 --- a/test.sh +++ b/test.sh @@ -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)