diff options
| author | Andreas Kapp Lindquist <andkaplin05@gmail.com> | 2025-10-30 10:56:41 +0100 |
|---|---|---|
| committer | Andreas Kapp Lindquist <andkaplin05@gmail.com> | 2025-10-30 10:56:42 +0100 |
| commit | 5d5656e2b10d8e2cc050a0518025856018e2edb0 (patch) | |
| tree | d251ed2584ed86cde857f844306237cba9268637 | |
| parent | fb4efd3131c2223cd56376c56704d30f20efc29e (diff) | |
| download | sorter-5d5656e2b10d8e2cc050a0518025856018e2edb0.tar.gz sorter-5d5656e2b10d8e2cc050a0518025856018e2edb0.zip | |
test(test.sh): Made use of exit codes
Diffstat (limited to '')
| -rwxr-xr-x | test/test.sh | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/test/test.sh b/test/test.sh index bd7f430..9aeeac9 100755 --- a/test/test.sh +++ b/test/test.sh @@ -25,16 +25,18 @@ for ALGORITHM in $ALGORITHMS; do for TEST_FILE in "$DATA_DIR"/*; do total=$((total + 1)) FILE_NAME=$(basename "$TEST_FILE") - echo "Testing $FILE_NAME with $ALGORITHM ..." + + echo -n "Testing $FILE_NAME with $ALGORITHM ... " "$SORTER" -a "$ALGORITHM" "$TEST_FILE" > temp - OUTPUT=$(python ./check.py "$TEST_FILE" temp 2>&1) + python ./check.py "$TEST_FILE" temp >/dev/null 2>&1 + status=$? - if [ -z "$OUTPUT" ]; then - echo "Passed: $FILE_NAME" + if [ $status -eq 0 ]; then + echo "✅Passed" passed=$((passed + 1)) else - echo "Failed: $FILE_NAME" + echo "❎Failed (code $status)" failed=$((failed + 1)) fi done |