Browse Source

Remove use of `local` from scripts

signals
Gavin Howard 3 years ago
parent
commit
62421e978d
Signed by untrusted user who does not match committer: gavin
GPG Key ID: C08038BDF280D33E
  1. 159
      functions.sh
  2. 8
      locale_install.sh
  3. 152
      release.sh
  4. 16
      tests/all.sh
  5. 8
      tests/errors.sh
  6. 6
      tests/read.sh

159
functions.sh

@ -29,26 +29,26 @@
readlink() {
local f="$1"
_readlink_f="$1"
shift
local arrow="-> "
local d=$(dirname "$f")
_readlink_arrow="-> "
_readlink_d=$(dirname "$_readlink_f")
local lsout=""
local link=""
_readlink_lsout=""
_readlink_link=""
lsout=$(ls -dl "$f")
link=$(printf '%s' "${lsout#*$arrow}")
_readlink_lsout=$(ls -dl "$_readlink_f")
_readlink_link=$(printf '%s' "${_readlink_lsout#*$_readlink_arrow}")
while [ -z "${lsout##*$arrow*}" ]; do
f="$d/$link"
d=$(dirname "$f")
lsout=$(ls -dl "$f")
link=$(printf '%s' "${lsout#*$arrow}")
while [ -z "${_readlink_lsout##*$_readlink_arrow*}" ]; do
_readlink_f="$_readlink_d/$_readlink_link"
_readlink_d=$(dirname "$_readlink_f")
_readlink_lsout=$(ls -dl "$_readlink_f")
_readlink_link=$(printf '%s' "${_readlink_lsout#*$_readlink_arrow}")
done
printf '%s' "${f##*$d/}"
printf '%s' "${_readlink_f##*$_readlink_d/}"
}
err_exit() {
@ -65,145 +65,154 @@ err_exit() {
die() {
local d="$1"
_die_d="$1"
shift
local msg="$1"
_die_msg="$1"
shift
local name="$1"
_die_name="$1"
shift
local err="$1"
_die_err="$1"
shift
str=$(printf '\n%s %s on test:\n\n %s\n' "$d" "$msg" "$name")
_die_str=$(printf '\n%s %s on test:\n\n %s\n' "$_die_d" "$_die_msg" "$_die_name")
err_exit "$str" "$err"
err_exit "$_die_str" "$_die_err"
}
checkcrash() {
local error="$1"
_checkcrash_d="$1"
shift
local name="$1"
_checkcrash_error="$1"
shift
if [ "$error" -gt 127 ]; then
die "$d" "crashed ($error)" "$name" "$error"
_checkcrash_name="$1"
shift
if [ "$_checkcrash_error" -gt 127 ]; then
die "$_checkcrash_d" "crashed ($_checkcrash_error)" \
"$_checkcrash_name" "$_checkcrash_error"
fi
}
checktest()
{
local error="$1"
_checktest_d="$1"
shift
_checktest_error="$1"
shift
local name="$1"
_checktest_name="$1"
shift
local out="$1"
_checktest_out="$1"
shift
local exebase="$1"
_checktest_exebase="$1"
shift
checkcrash "$error" "$name"
checkcrash "$_checktest_d" "$_checktest_error" "$_checktest_name"
if [ "$error" -eq 0 ]; then
die "$d" "returned no error" "$name" 127
if [ "$_checktest_error" -eq 0 ]; then
die "$_checktest_d" "returned no error" "$_checktest_name" 127
fi
if [ "$error" -eq 100 ]; then
if [ "$_checktest_error" -eq 100 ]; then
output=$(cat "$out")
fatal_error="Fatal error"
_checktest_output=$(cat "$_checktest_out")
_checktest_fatal_error="Fatal error"
if [ "${output##*$fatal_error*}" ]; then
printf "%s\n" "$output"
die "$d" "had memory errors on a non-fatal error" "$name" "$error"
if [ "${_checktest_output##*$_checktest_fatal_error*}" ]; then
printf "%s\n" "$_checktest_output"
die "$_checktest_d" "had memory errors on a non-fatal error" \
"$_checktest_name" "$_checktest_error"
fi
fi
if [ ! -s "$out" ]; then
die "$d" "produced no error message" "$name" "$error"
if [ ! -s "$_checktest_out" ]; then
die "$_checktest_d" "produced no error message" "$_checktest_name" "$_checktest_error"
fi
# Display the error messages if not directly running exe.
# This allows the script to print valgrind output.
if [ "$exebase" != "bc" -a "$exebase" != "dc" ]; then
cat "$out"
if [ "$_checktest_exebase" != "bc" -a "$_checktest_exebase" != "dc" ]; then
cat "$_checktest_out"
fi
}
substring_replace() {
local str="$1"
_substring_replace_str="$1"
shift
local needle="$1"
_substring_replace_needle="$1"
shift
local replacement="$1"
_substring_replace_replacement="$1"
shift
result=$(printf '%s' "$str" | sed -e "s!$needle!$replacement!g")
_substring_replace_result=$(printf '%s' "$_substring_replace_str" | \
sed -e "s!$_substring_replace_needle!$_substring_replace_replacement!g")
printf '%s\n' "$result"
printf '%s\n' "$_substring_replace_result"
}
gen_nlspath() {
local nlspath="$1"
_gen_nlspath_nlspath="$1"
shift
local locale="$1"
_gen_nlspath_locale="$1"
shift
local execname="$1"
_gen_nlspath_execname="$1"
shift
local char="@"
local modifier="${locale#*$char}"
local tmplocale="${locale%%$char*}"
_gen_nlspath_char="@"
_gen_nlspath_modifier="${_gen_nlspath_locale#*$_gen_nlspath_char}"
_gen_nlspath_tmplocale="${_gen_nlspath_locale%%$_gen_nlspath_char*}"
char="."
local charset="${tmplocale#*$char}"
tmplocale="${tmplocale%%$char*}"
_gen_nlspath_char="."
_gen_nlspath_charset="${_gen_nlspath_tmplocale#*$_gen_nlspath_char}"
_gen_nlspath_tmplocale="${_gen_nlspath_tmplocale%%$_gen_nlspath_char*}"
if [ "$charset" = "$tmplocale" ]; then
charset=""
if [ "$_gen_nlspath_charset" = "$_gen_nlspath_tmplocale" ]; then
_gen_nlspath_charset=""
fi
char="_"
local territory="${tmplocale#*$char}"
local language="${tmplocale%%$char*}"
_gen_nlspath_char="_"
_gen_nlspath_territory="${_gen_nlspath_tmplocale#*$_gen_nlspath_char}"
_gen_nlspath_language="${_gen_nlspath_tmplocale%%$_gen_nlspath_char*}"
if [ "$territory" = "$tmplocale" ]; then
territory=""
if [ "$_gen_nlspath_territory" = "$_gen_nlspath_tmplocale" ]; then
_gen_nlspath_territory=""
fi
if [ "$language" = "$tmplocale" ]; then
language=""
if [ "$_gen_nlspath_language" = "$_gen_nlspath_tmplocale" ]; then
_gen_nlspath_language=""
fi
local needles="%%:%L:%N:%l:%t:%c"
_gen_nlspath_needles="%%:%L:%N:%l:%t:%c"
needles=$(printf '%s' "$needles" | tr ':' '\n')
_gen_nlspath_needles=$(printf '%s' "$_gen_nlspath_needles" | tr ':' '\n')
for i in $needles; do
nlspath=$(substring_replace "$nlspath" "$i" "|$i|")
for _gen_nlspath_i in $_gen_nlspath_needles; do
_gen_nlspath_nlspath=$(substring_replace "$_gen_nlspath_nlspath" "$_gen_nlspath_i" "|$_gen_nlspath_i|")
done
nlspath=$(substring_replace "$nlspath" "%%" "%")
nlspath=$(substring_replace "$nlspath" "%L" "$locale")
nlspath=$(substring_replace "$nlspath" "%N" "$execname")
nlspath=$(substring_replace "$nlspath" "%l" "$language")
nlspath=$(substring_replace "$nlspath" "%t" "$territory")
nlspath=$(substring_replace "$nlspath" "%c" "$charset")
_gen_nlspath_nlspath=$(substring_replace "$_gen_nlspath_nlspath" "%%" "%")
_gen_nlspath_nlspath=$(substring_replace "$_gen_nlspath_nlspath" "%L" "$_gen_nlspath_locale")
_gen_nlspath_nlspath=$(substring_replace "$_gen_nlspath_nlspath" "%N" "$_gen_nlspath_execname")
_gen_nlspath_nlspath=$(substring_replace "$_gen_nlspath_nlspath" "%l" "$_gen_nlspath_language")
_gen_nlspath_nlspath=$(substring_replace "$_gen_nlspath_nlspath" "%t" "$_gen_nlspath_territory")
_gen_nlspath_nlspath=$(substring_replace "$_gen_nlspath_nlspath" "%c" "$_gen_nlspath_charset")
nlspath=$(printf '%s' "$nlspath" | tr -d '|')
_gen_nlspath_nlspath=$(printf '%s' "$_gen_nlspath_nlspath" | tr -d '|')
printf '%s' "$nlspath"
printf '%s' "$_gen_nlspath_nlspath"
}

8
locale_install.sh

@ -34,14 +34,14 @@ usage() {
gencatfile() {
local loc="$1"
_gencatfile_loc="$1"
shift
local file="$1"
_gencatfile_file="$1"
shift
mkdir -p $(dirname "$loc")
gencat "$loc" "$file" > /dev/null 2>&1
mkdir -p $(dirname "$_gencatfile_loc")
gencat "$_gencatfile_loc" "$_gencatfile_file" > /dev/null 2>&1
}
script="$0"

152
release.sh

@ -34,12 +34,12 @@ usage() {
header() {
local msg="$1"
_header_msg="$1"
shift
printf '\n'
printf '*******************\n'
printf '%s...\n' "$msg"
printf '%s...\n' "$_header_msg"
printf '*******************\n'
printf '\n'
}
@ -50,47 +50,47 @@ do_make() {
configure() {
local CFLAGS="$1"
_configure_CFLAGS="$1"
shift
local CC="$1"
_configure_CC="$1"
shift
local configure_flags="$1"
_configure_configure_flags="$1"
shift
if [ "$gen_tests" -eq 0 ]; then
configure_flags="-G $configure_flags"
_configure_configure_flags="-G $_configure_configure_flags"
fi
if [ "$CC" = "clang" ]; then
CFLAGS="$clang_flags $CFLAGS"
if [ "$_configure_CC" = "clang" ]; then
_configure_CFLAGS="$clang_flags $_configure_CFLAGS"
fi
header "Running \"./configure.sh $configure_flags\" with CC=\"$CC\" and CFLAGS=\"$CFLAGS\""
CFLAGS="$CFLAGS" CC="$CC" ./configure.sh $configure_flags > /dev/null
header "Running \"./configure.sh $_configure_configure_flags\" with CC=\"$_configure_CC\" and CFLAGS=\"$_configure_CFLAGS\""
CFLAGS="$_configure_CFLAGS" CC="$_configure_CC" ./configure.sh $_configure_configure_flags > /dev/null
}
build() {
local CFLAGS="$1"
_build_CFLAGS="$1"
shift
local CC="$1"
_build_CC="$1"
shift
local configure_flags="$1"
_build_configure_flags="$1"
shift
configure "$CFLAGS" "$CC" "$configure_flags"
configure "$_build_CFLAGS" "$_build_CC" "$_build_configure_flags"
header "Building with CC=\"$CC\" and CFLAGS=\"$CFLAGS\""
header "Building with CC=\"$_build_CC\" and CFLAGS=\"$_build_CFLAGS\""
do_make > /dev/null 2> "$scriptdir/.test.txt"
if [ -s "$scriptdir/.test.txt" ]; then
printf '%s generated warning(s):\n' "$CC"
printf '%s generated warning(s):\n' "$_build_CC"
printf '\n'
cat "$scriptdir/.test.txt"
exit 1
@ -110,40 +110,40 @@ runtest() {
runconfigtests() {
local CFLAGS="$1"
_runconfigtests_CFLAGS="$1"
shift
local CC="$1"
_runconfigtests_CC="$1"
shift
local configure_flags="$1"
_runconfigtests_configure_flags="$1"
shift
local run_tests="$1"
_runconfigtests_run_tests="$1"
shift
if [ "$run_tests" -ne 0 ]; then
header "Running tests with configure flags \"$configure_flags\", CC=\"$CC\", and CFLAGS=\"$CFLAGS\""
if [ "$_runconfigtests_run_tests" -ne 0 ]; then
header "Running tests with configure flags \"$_runconfigtests_configure_flags\", CC=\"$_runconfigtests_CC\", and CFLAGS=\"$_runconfigtests_CFLAGS\""
else
header "Building with configure flags \"$configure_flags\", CC=\"$CC\", and CFLAGS=\"$CFLAGS\""
header "Building with configure flags \"$_runconfigtests_configure_flags\", CC=\"$_runconfigtests_CC\", and CFLAGS=\"$_runconfigtests_CFLAGS\""
fi
build "$CFLAGS" "$CC" "$configure_flags"
if [ "$run_tests" -ne 0 ]; then
build "$_runconfigtests_CFLAGS" "$_runconfigtests_CC" "$_runconfigtests_configure_flags"
if [ "$_runconfigtests_run_tests" -ne 0 ]; then
runtest
fi
do_make clean
build "$CFLAGS" "$CC" "$configure_flags -b"
if [ "$run_tests" -ne 0 ]; then
build "$_runconfigtests_CFLAGS" "$_runconfigtests_CC" "$_runconfigtests_configure_flags -b"
if [ "$_runconfigtests_run_tests" -ne 0 ]; then
runtest
fi
do_make clean
build "$CFLAGS" "$CC" "$configure_flags -d"
if [ "$run_tests" -ne 0 ]; then
build "$_runconfigtests_CFLAGS" "$_runconfigtests_CC" "$_runconfigtests_configure_flags -d"
if [ "$_runconfigtests_run_tests" -ne 0 ]; then
runtest
fi
@ -152,51 +152,51 @@ runconfigtests() {
runtestseries() {
local CFLAGS="$1"
_runtestseries_CFLAGS="$1"
shift
local CC="$1"
_runtestseries_CC="$1"
shift
local configure_flags="$1"
_runtestseries_configure_flags="$1"
shift
local run_tests="$1"
_runtestseries_run_tests="$1"
shift
runconfigtests "$CFLAGS" "$CC" "$configure_flags" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -E" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -H" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -N" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -S" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -EH" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -EN" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -ES" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -HN" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -HS" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -NS" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -EHN" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -EHS" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -ENS" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -HNS" "$run_tests"
runconfigtests "$CFLAGS" "$CC" "$configure_flags -EHNS" "$run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -E" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -H" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -N" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -S" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -EH" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -EN" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -ES" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -HN" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -HS" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -NS" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -EHN" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -EHS" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -ENS" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -HNS" "$_runtestseries_run_tests"
runconfigtests "$_runtestseries_CFLAGS" "$_runtestseries_CC" "$_runtestseries_configure_flags -EHNS" "$_runtestseries_run_tests"
}
runtests() {
local CFLAGS="$1"
_runtests_CFLAGS="$1"
shift
local CC="$1"
_runtests_CC="$1"
shift
local configure_flags="$1"
_runtests_configure_flags="$1"
shift
local run_tests="$1"
_runtests_run_tests="$1"
shift
runtestseries "$CFLAGS" "$CC" "$configure_flags" "$run_tests"
runtestseries "$_runtests_CFLAGS" "$_runtests_CC" "$_runtests_configure_flags" "$_runtests_run_tests"
}
karatsuba() {
@ -227,66 +227,66 @@ vg() {
debug() {
local CC="$1"
_debug_CC="$1"
shift
local run_tests="$1"
_debug_run_tests="$1"
shift
runtests "$debug" "$CC" "-g" "$run_tests"
runtests "$debug" "$_debug_CC" "-g" "$_debug_run_tests"
if [ "$CC" = "clang" -a "$run_sanitizers" -ne 0 ]; then
runtests "$debug -fsanitize=address" "$CC" "-g" "$run_tests"
runtests "$debug -fsanitize=undefined" "$CC" "-g" "$run_tests"
runtests "$debug -fsanitize=memory" "$CC" "-g" "$run_tests"
if [ "$_debug_CC" = "clang" -a "$run_sanitizers" -ne 0 ]; then
runtests "$debug -fsanitize=address" "$_debug_CC" "-g" "$_debug_run_tests"
runtests "$debug -fsanitize=undefined" "$_debug_CC" "-g" "$_debug_run_tests"
runtests "$debug -fsanitize=memory" "$_debug_CC" "-g" "$_debug_run_tests"
fi
}
release() {
local CC="$1"
_release_CC="$1"
shift
local run_tests="$1"
_release_run_tests="$1"
shift
runtests "$release" "$CC" "-O3" "$run_tests"
runtests "$release" "$_release_CC" "-O3" "$_release_run_tests"
}
reldebug() {
local CC="$1"
_reldebug_CC="$1"
shift
local run_tests="$1"
_reldebug_run_tests="$1"
shift
runtests "$debug" "$CC" "-gO3" "$run_tests"
runtests "$debug" "$_reldebug_CC" "-gO3" "$_reldebug_run_tests"
}
minsize() {
local CC="$1"
_minsize_CC="$1"
shift
local run_tests="$1"
_minsize_run_tests="$1"
shift
runtests "$release" "$CC" "-Os" "$run_tests"
runtests "$release" "$_minsize_CC" "-Os" "$_minsize_run_tests"
}
build_set() {
local CC="$1"
_build_set_CC="$1"
shift
local run_tests="$1"
_build_set_run_tests="$1"
shift
debug "$CC" "$run_tests"
release "$CC" "$run_tests"
reldebug "$CC" "$run_tests"
minsize "$CC" "$run_tests"
debug "$_build_set_CC" "$_build_set_run_tests"
release "$_build_set_CC" "$_build_set_run_tests"
reldebug "$_build_set_CC" "$_build_set_run_tests"
minsize "$_build_set_CC" "$_build_set_run_tests"
}
clang_flags="-Weverything -Wno-padded -Wno-switch-enum -Wno-format-nonliteral"

16
tests/all.sh

@ -179,34 +179,34 @@ set +e
"$exe" "$@" -f "saotehasotnehasthistohntnsahxstnhalcrgxgrlpyasxtsaosysxsatnhoy.txt" > /dev/null 2> "$out2"
err="$?"
checktest "$err" "invalid file argument" "$out2" "$d"
checktest "$d" "$err" "invalid file argument" "$out2" "$d"
"$exe" "$@" "-$opt" -e "$exprs" > /dev/null 2> "$out2"
err="$?"
checktest "$err" "invalid option argument" "$out2" "$d"
checktest "$d" "$err" "invalid option argument" "$out2" "$d"
"$exe" "$@" "--$lopt" -e "$exprs" > /dev/null 2> "$out2"
err="$?"
checktest "$err" "invalid long option argument" "$out2" "$d"
checktest "$d" "$err" "invalid long option argument" "$out2" "$d"
"$exe" "$@" "-u" -e "$exprs" > /dev/null 2> "$out2"
err="$?"
checktest "$err" "unrecognized option argument" "$out2" "$d"
checktest "$d" "$err" "unrecognized option argument" "$out2" "$d"
"$exe" "$@" "--uniform" -e "$exprs" > /dev/null 2> "$out2"
err="$?"
checktest "$err" "unrecognized long option argument" "$out2" "$d"
checktest "$d" "$err" "unrecognized long option argument" "$out2" "$d"
printf 'Running %s directory test...\n' "$d"
"$exe" "$@" "$testdir" > /dev/null 2> "$out2"
err="$?"
checktest "$err" "directory" "$out2" "$d"
checktest "$d" "$err" "directory" "$out2" "$d"
printf 'Running %s binary file test...\n' "$d"
@ -215,14 +215,14 @@ bin="/bin/sh"
"$exe" "$@" "$bin" > /dev/null 2> "$out2"
err="$?"
checktest "$err" "binary file" "$out2" "$d"
checktest "$d" "$err" "binary file" "$out2" "$d"
printf 'Running %s binary stdin test...\n' "$d"
cat "$bin" | "$exe" "$@" > /dev/null 2> "$out2"
err="$?"
checktest "$err" "binary stdin" "$out2" "$d"
checktest "$d" "$err" "binary stdin" "$out2" "$d"
if [ "$d" = "bc" ]; then

8
tests/errors.sh

@ -83,7 +83,7 @@ for testfile in $testdir/$d/*errors.txt; do
die "$d" "returned an error ($err)" "POSIX warning" 1
fi
checktest "1" "$line" "$out" "$exebase"
checktest "$d" "1" "$line" "$out" "$exebase"
options="-ls"
else
@ -101,7 +101,7 @@ for testfile in $testdir/$d/*errors.txt; do
printf '%s\n' "$line" | "$exe" "$@" "$options" 2> "$out" > /dev/null
err="$?"
checktest "$err" "$line" "$out" "$exebase"
checktest "$d" "$err" "$line" "$out" "$exebase"
done < "$testfile"
@ -114,13 +114,13 @@ for testfile in $testdir/$d/errors/*.txt; do
printf '%s\n' "$halt" | "$exe" "$@" $opts "$testfile" 2> "$out" > /dev/null
err="$?"
checktest "$err" "$testfile" "$out" "$exebase"
checktest "$d" "$err" "$testfile" "$out" "$exebase"
printf 'Running %s error file %s through cat...\n' "$d" "$testfile"
cat "$testfile" | "$exe" "$@" $opts 2> "$out" > /dev/null
err="$?"
checkcrash "$err" "$testfile"
checkcrash "$d" "$err" "$testfile"
done

6
tests/read.sh

@ -95,7 +95,7 @@ while read line; do
printf '%s\n%s\n' "$read_call" "$line" | "$exe" "$@" "$options" 2> "$out" > /dev/null
err="$?"
checktest "$err" "$line" "$out" "$exebase"
checktest "$d" "$err" "$line" "$out" "$exebase"
done < "$errors"
@ -106,7 +106,7 @@ read_test=$(printf '%s\n' "$read_call")
printf '%s\n' "$read_test" | "$exe" "$@" "$opts" 2> "$out" > /dev/null
err="$?"
checktest "$err" "$read_test" "$out" "$exebase"
checktest "$d" "$err" "$read_test" "$out" "$exebase"
printf 'Running %s read EOF...\n' "$d"
@ -115,4 +115,4 @@ read_test=$(printf '%s' "$read_call")
printf '%s' "$read_test" | "$exe" "$@" "$opts" 2> "$out" > /dev/null
err="$?"
checktest "$err" "$read_test" "$out" "$exebase"
checktest "$d" "$err" "$read_test" "$out" "$exebase"

Loading…
Cancel
Save