diff options
| author | Andreas Kapp Lindquist <andkaplin05@gmail.com> | 2025-10-23 17:55:39 +0200 |
|---|---|---|
| committer | mithe24 <mithe24@student.sdu.dk> | 2025-10-29 13:49:57 +0100 |
| commit | bb687ca28d9da1e161b8e382771fe919fa698b01 (patch) | |
| tree | 59fd68fedd99ac4c67f60b62f91b644c84b84b8c /test.sh | |
| parent | 0ec400a4243356951a7096ea1d6534b582134f9f (diff) | |
| download | sorter-bb687ca28d9da1e161b8e382771fe919fa698b01.tar.gz sorter-bb687ca28d9da1e161b8e382771fe919fa698b01.zip | |
test(test.sh): Moved to test folder
Diffstat (limited to 'test.sh')
| -rwxr-xr-x | test.sh | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/test.sh b/test.sh deleted file mode 100755 index 8cf9240..0000000 --- a/test.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -DATA_DIR="data" - -SRC_DIR="src" -SORTER="$SRC_DIR/sorter" -REF="sort -s -n -k 2" # '-s' for using a stable algo - -total=0 -passed=0 -failed=0 - -for TEST_FILE in "$DATA_DIR"/*; do - ((total++)) - FILE_NAME=$(basename "$TEST_FILE") - DIFF_FILE="$FILE_NAME.diff" - - echo "Testing $FILE_NAME ..." - - diff -u <($REF "$TEST_FILE") <($SORTER "$TEST_FILE") > "$DIFF_FILE" - if [ ! -s "$DIFF_FILE" ]; then - echo "Passed: $TEST_FILE" - ((passed++)) - rm -f "$DIFF_FILE" - else - echo "Failed: $TEST_FILE" - ((failed++)) - fi -done - -# Summary overview -echo "==============================" -echo "Test Summary:" -echo "Total tests: $total" -echo "Passed: $passed" -echo "Failed: $failed" -echo "==============================" - -if [ $failed -ne 0 ]; then - echo "Diff files for failed tests are saved" -fi |