aboutsummaryrefslogtreecommitdiff
path: root/test/test.sh
diff options
context:
space:
mode:
authorAndreas Kapp Lindquist <andkaplin05@gmail.com>2025-10-30 10:56:41 +0100
committerAndreas Kapp Lindquist <andkaplin05@gmail.com>2025-10-30 10:56:42 +0100
commit5d5656e2b10d8e2cc050a0518025856018e2edb0 (patch)
treed251ed2584ed86cde857f844306237cba9268637 /test/test.sh
parentfb4efd3131c2223cd56376c56704d30f20efc29e (diff)
downloadsorter-5d5656e2b10d8e2cc050a0518025856018e2edb0.tar.gz
sorter-5d5656e2b10d8e2cc050a0518025856018e2edb0.zip
test(test.sh): Made use of exit codes
Diffstat (limited to '')
-rwxr-xr-xtest/test.sh12
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