mirror of
https://github.com/libssh2/libssh2.git
synced 2025-11-18 15:20:56 +03:00
To run test program via `wine`: ```shell export LIBSSH2_TEST_EXE_RUNNER=wine ``` It prefixes commands with the specified runner. For systems where this isn't automatic or supported, e.g. macOS. Closes #1562
37 lines
766 B
Bash
Executable File
37 lines
766 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Copyright (C) Viktor Szakats
|
|
# SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
set -e
|
|
set -u
|
|
|
|
# https://testanything.org/tap-specification.html
|
|
|
|
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}" ${LIBSSH2_TEST_EXE_RUNNER:-} "${testbin}"; then
|
|
res='ok'
|
|
else
|
|
res='not ok'
|
|
fi
|
|
else
|
|
if FIXTURE_TEST_CRYPT="${test}" ${LIBSSH2_TEST_EXE_RUNNER:-} "${testbin}"; then
|
|
res='ok'
|
|
else
|
|
res='not ok'
|
|
fi
|
|
fi
|
|
echo "${res} ${count} - test_read-${test}"
|
|
((count++))
|
|
done <<< "${algos}"
|