1
0
mirror of https://github.com/libssh2/libssh2.git synced 2025-08-05 20:55:47 +03:00

tests: set -e -u in shell scripts

Cherry-picked from #1017
This commit is contained in:
Viktor Szakats
2023-05-03 12:55:59 +00:00
parent 612ca85aaa
commit 0a29a63ca6
4 changed files with 10 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
#!/bin/sh
set -e
set -u
# Generate test keys

View File

@@ -1,6 +1,7 @@
#!/bin/sh
set -e
set -u
# Written by Mikhail Gusarov
#

View File

@@ -1,5 +1,8 @@
#!/usr/bin/env bash
set -e
set -u
# https://testanything.org/tap-specification.html
if [[ "$(uname)" = *'_NT'* ]]; then
@@ -8,7 +11,7 @@ if [[ "$(uname)" = *'_NT'* ]]; then
exit 0
fi
testbin="./test_read${EXEEXT}"
testbin="./test_read${EXEEXT:-}"
d="$(dirname "$0")"
algos="$(tr -d $"\r" < "${d}/test_read_algos.txt")"

View File

@@ -1,5 +1,8 @@
#!/usr/bin/env bash
set -e
set -u
# https://testanything.org/tap-specification.html
d="$(dirname "$0")"
@@ -25,7 +28,7 @@ total="$(echo "${tests}" | wc -w | tr -d ' ')"
echo "${count}..${total}"
for test in ${tests}; do
if "${d}/sshd_fixture.sh" "./${test}${EXEEXT}"; then
if "${d}/sshd_fixture.sh" "./${test}${EXEEXT:-}"; then
res='ok'
else
res='not ok'