1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-11-18 15:20:56 +03:00
Files
libssh2/tests/test_read_algos.test
Viktor Szakats 0a29a63ca6 tests: set -e -u in shell scripts
Cherry-picked from #1017
2023-05-03 12:56:36 +00:00

41 lines
818 B
Bash
Executable File

#!/usr/bin/env bash
set -e
set -u
# https://testanything.org/tap-specification.html
if [[ "$(uname)" = *'_NT'* ]]; then
# 'no matching manifest for windows/amd64 in the manifest list entries'
echo "1..0 # skip test_read tests due to docker issues"
exit 0
fi
testbin="./test_read${EXEEXT:-}"
d="$(dirname "$0")"
algos="$(tr -d $"\r" < "${d}/test_read_algos.txt")"
count=1
total="$(echo "${algos}" | wc -l | tr -d ' ')"
echo "${count}..${total}"
while read -r test; do
if [[ "${test}" = *'mac-'* ]]; then
if FIXTURE_TEST_MAC="${test}" "${testbin}"; then
res='ok'
else
res='not ok'
fi
else
if FIXTURE_TEST_CRYPT="${test}" "${testbin}"; then
res='ok'
else
res='not ok'
fi
fi
echo "${res} ${count} - test_read-${test}"
((count++))
done <<< "${algos}"