File: test_read_algos.test

package info (click to toggle)
libssh2 1.11.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 6,504 kB
  • sloc: ansic: 46,104; sh: 6,164; makefile: 348; cpp: 120; perl: 65; lisp: 33; awk: 23
file content (36 lines) | stat: -rwxr-xr-x 708 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/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}" "${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}"