Skip to content

Commit

Permalink
bash tests - count failures
Browse files Browse the repository at this point in the history
  • Loading branch information
vmikk committed Oct 19, 2024
1 parent ef9f288 commit 2af09fc
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/test2_binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

set -euo pipefail

# Initialize a variable to track test failures
failed=0

# Test basic usage
function test_basic_usage {
result=$(../seqhasher test2.fasta -)
Expand All @@ -15,6 +18,13 @@ AAAA
EOF
)
if [[ "$result" != "$expected" ]]; then
echo -e "\e[31mBasic usage test failed\e[0m"
failed=1
else
echo -e "\e[32mBasic usage test passed\e[0m"
fi
}


# Test headers only
function test_headers_only {
Expand Down Expand Up @@ -81,3 +91,10 @@ test_headers_only
test_no_filename
test_xxhash_case_sensitive
test_multiple_hashes
if [[ $failed -eq 0 ]]; then
echo -e "\e[32mAll tests passed\e[0m"
exit 0
else
echo -e "\e[31mSome tests failed\e[0m"
exit 1
fi

0 comments on commit 2af09fc

Please sign in to comment.