diff --git a/COPYING b/COPYING index 94a9ed024..f288702d2 100644 --- a/COPYING +++ b/COPYING @@ -1,7 +1,7 @@ GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box". You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see -. +. The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read -. +. diff --git a/appveyor.sh b/appveyor.sh deleted file mode 100755 index 11fc06798..000000000 --- a/appveyor.sh +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -# -# Cleanup for Appveyor peculiarities. -# - -# Echo, eval, and error on shell commands. -eeval() -{ - echo "$0: $*" >&2 - eval "$@" - rv=$? - if [ $rv -ne 0 ]; then - echo "$0: failed, exitcode $rv" - exit $rv - fi - return 0 -} - -# We inherit a broken Windows path with a Windows Git. -PATH=/bin - -# This supposedly fixes some failures. -exec 0 /dev/null 2>&1; then - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" fi } diff --git a/macosx/build.sh b/macosx/build.sh index 7740fcca1..43d5615c5 100755 --- a/macosx/build.sh +++ b/macosx/build.sh @@ -125,7 +125,7 @@ if which -s pkgbuild; then --package-path . \ "$OUTFILE" echo "Cleaning up..." - rm -rf $PKGID + rm -rf "$PKGID" else echo "Preprocessing package description..." INDIR=mosh-package.pmdoc.in diff --git a/scripts/wrap-compiler-for-flag-check b/scripts/wrap-compiler-for-flag-check index 7d074d7d1..32af2314e 100755 --- a/scripts/wrap-compiler-for-flag-check +++ b/scripts/wrap-compiler-for-flag-check @@ -18,5 +18,5 @@ if out=$("$@" 2>&1); then else code=$? echo "$out" - exit $code + exit "$code" fi diff --git a/src/tests/README.md b/src/tests/README.md index 0f59f5f1c..ee9a64241 100644 --- a/src/tests/README.md +++ b/src/tests/README.md @@ -83,7 +83,7 @@ actions, which are expected to be identical. actions, which are expected to be different. `post` is a catchall script hook which allows custom verification -acions to be coded. +actions to be coded. ### Client wrappers diff --git a/src/tests/e2e-failure.test b/src/tests/e2e-failure.test index 038529526..02a267a48 100755 --- a/src/tests/e2e-failure.test +++ b/src/tests/e2e-failure.test @@ -4,13 +4,13 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline variant different exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi diff --git a/src/tests/e2e-success.test b/src/tests/e2e-success.test index 3225e76bf..bb64df995 100755 --- a/src/tests/e2e-success.test +++ b/src/tests/e2e-success.test @@ -4,13 +4,13 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline direct variant verify same exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi diff --git a/src/tests/e2e-test b/src/tests/e2e-test index c0e9d27d0..446d3d760 100755 --- a/src/tests/e2e-test +++ b/src/tests/e2e-test @@ -22,7 +22,7 @@ dump_logs() dir=$1 shift testname=$(basename "$dir" .d) - for logfile in $dir/*.tmux.log; do + for logfile in "$dir"/*.tmux.log; do printf "travis_fold:start:%s-%s\n" "$testname" "$(basename "$logfile")" cat "$logfile" printf "travis_fold:end:%s-%s\n" "$testname" "$(basename "$logfile")" @@ -60,7 +60,7 @@ test_exitstatus() ssh_localhost_check() { ssh localhost : - if [ $? -ne 0 ]; then + if [ "$?" -ne 0 ]; then error "ssh to localhost failed\n" return 1 fi @@ -93,7 +93,7 @@ if [ -z "$srcdir" ]; then export srcdir=$PWD else srcdir="$(cd "$srcdir" && pwd)" - if [ $? -ne 0 ]; then + if [ "$?" -ne 0 ]; then error "can't cd to srcdir: %s\n" "$srcdir" exit 99 fi @@ -113,7 +113,7 @@ case "$(basename "$0")" in ;; esac -if [ $# -lt 2 ]; then +if [ "$#" -lt 2 ]; then test_error "not enough args\n" fi @@ -144,10 +144,10 @@ mkdir "${test_dir}" on_exit() { rv=$? - if test $rv -ne 0; then + if test "$rv" -ne 0; then dump_logs "$test_dir" $test_args fi - exit $rv + exit "$rv" } trap on_exit EXIT @@ -219,7 +219,7 @@ for run in $server_tests; do ${tmux_stdin} tmux -f /dev/null -S "${tmux_socket}" -C new-session -x 80 -y 24 "${srcdir}/print-exitstatus ${client_wrapper} ${sut} ${server_wrapper} \"${PWD}/${test_dir}/${run}\" \"${PWD}/${test_script} ${run}\"" > "${test_dir}/${run}.tmux.log" rv=$? rm -f "${tmux_socket}" "${test_dir}/tmux-socket" - if [ $rv -ne 0 ]; then + if [ "$rv" -ne 0 ]; then test_error "tmux failure on test %s\n" "$run" fi # Check for mosh failures @@ -244,13 +244,13 @@ for run in $server_tests; do test_error "Round-trip Instruction verification failed on server during %s\n" "$run" fi # Check for 0-timeout select() issue - if egrep -q "(polls, rate limiting|consecutive polls)" "${test_dir}/${run}.server.stderr"; then + if grep -E -q "(polls, rate limiting|consecutive polls)" "${test_dir}/${run}.server.stderr"; then if [ "osx" != "${TRAVIS_OS_NAME}" ]; then test_error "select() with zero timeout called too often on server during %s\n" "$run" fi fi # Check for assert() - if egrep -q "assertion.*failed" "${test_dir}/${run}.server.stderr"; then + if grep -E -q "assertion.*failed" "${test_dir}/${run}.server.stderr"; then test_error "assertion during %s\n" "$run" fi fi @@ -282,7 +282,7 @@ for compare in $compare_tests; do desired=n badresult=different fi - if [ $differ != $desired ]; then + if [ "$differ" != "$desired" ]; then test_failure "Output is %s between tests %s and %s\n" "$badresult" "$test1" "$test2" fi done @@ -291,7 +291,7 @@ done if [ -n "$post" ]; then "${test_script}" post status=$? - if [ $status -ne 0 ]; then - test_exitstatus $status "Post test failed with exitstatus %d\n" $status + if [ "$status" -ne 0 ]; then + test_exitstatus "$status" "Post test failed with exitstatus %d\n" "$status" fi fi diff --git a/src/tests/e2e-test-server b/src/tests/e2e-test-server index fc6d15a00..9228d7d6c 100755 --- a/src/tests/e2e-test-server +++ b/src/tests/e2e-test-server @@ -17,11 +17,11 @@ wait_for_clients() expected=$1 while true; do n=$(tmux list-clients -F . | wc -l) - if [ $expected -eq 1 ]; then - if [ $n -eq 1 ]; then + if [ "$expected" -eq 1 ]; then + if [ "$n" -eq 1 ]; then return fi - elif [ $n -ne 1 ]; then + elif [ "$n" -ne 1 ]; then return fi sleep 1 @@ -30,7 +30,7 @@ wait_for_clients() export MOSH_SERVER_PID=$PPID -if [ $# -lt 2 ]; then +if [ "$#" -lt 2 ]; then printf "not enough args\n" >&2 exit 99 fi @@ -40,8 +40,8 @@ rm -f "$testname.capture" "$testname.exitstatus" trap ":" TERM HUP QUIT # If the session closes on us, let the test we're running drive. on_exit() { rv=$? - echo $rv > "$testname.exitstatus" - exit $rv + echo "$rv" > "$testname.exitstatus" + exit "$rv" } trap on_exit EXIT # check for tmux @@ -55,7 +55,7 @@ eval "$@" testret=$? # Capture mosh-server runtime if possible. runtime=$(ps -o time= $PPID 2>/dev/null) -if [ $? -ne 0 ]; then # Cygwin... +if [ "$?" -ne 0 ]; then # Cygwin... runtime=- fi # Wait for tmux client screen to become up to date. @@ -63,14 +63,14 @@ sleep 1 printf "@@@ server complete @@@" >&2 wait_for_clients 1 i=0 -while [ $i -lt 60 ]; do +while [ "$i" -lt 60 ]; do if grep -q "@@@ server complete @@@" "$testname.tmux.log"; then break fi i=$((i+1)) sleep 1 done -if [ $i -ge 60 ]; then +if [ "$i" -ge 60 ]; then printf "wait for tmux client update failed, erroring test\n" >&2 exit 99 fi @@ -86,7 +86,7 @@ fi # Dump runtime into tmux log. printf "@@@ runtime %s @@@\n" "$runtime" # return useful exitstatus from harnessed command -if [ $testret -ne 0 ]; then +if [ "$testret" -ne 0 ]; then exit 1 fi exit 0 diff --git a/src/tests/e2e-test-subrs b/src/tests/e2e-test-subrs index 8f2054bae..de8b98358 100644 --- a/src/tests/e2e-test-subrs +++ b/src/tests/e2e-test-subrs @@ -23,7 +23,7 @@ sleepf() seq_function() { - if [ $# -lt 1 ] || [ $# -gt 3 ]; then + if [ "$#" -lt 1 ] || [ "$#" -gt 3 ]; then echo "bad args" >&2 fi first=$1 @@ -95,7 +95,7 @@ tmux_check() fi fi version=$(tmux -V) - if [ $? != 0 ]; then + if [ "$?" != 0 ]; then error "tmux unavailable\n" return 1 fi @@ -119,7 +119,7 @@ tmux_check() tmux_check_socket=$(mktemp -d /tmp/mosh-tmux-check.XXXXXXXX) tmux -f /dev/null -S "${tmux_check_socket}/s" -C new-session true rv=$? - rm ${tmux_check_socket}/s - rmdir ${tmux_check_socket} - return $rv + rm "${tmux_check_socket}/s" + rmdir "${tmux_check_socket}" + return "$rv" } diff --git a/src/tests/emulation-80th-column.test b/src/tests/emulation-80th-column.test index b33cc442c..9ef82a589 100755 --- a/src/tests/emulation-80th-column.test +++ b/src/tests/emulation-80th-column.test @@ -12,13 +12,13 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline post exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi diff --git a/src/tests/emulation-ascii-iso-8859.test b/src/tests/emulation-ascii-iso-8859.test index b50a00188..911192c64 100755 --- a/src/tests/emulation-ascii-iso-8859.test +++ b/src/tests/emulation-ascii-iso-8859.test @@ -8,13 +8,13 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline direct verify exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi diff --git a/src/tests/emulation-attributes.test b/src/tests/emulation-attributes.test index e4ba2f3fe..c0591dc41 100755 --- a/src/tests/emulation-attributes.test +++ b/src/tests/emulation-attributes.test @@ -15,33 +15,33 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Need 2.3 for true-color support (2.2 may work also) -if [ "$(basename "$0")" = emulation-attributes-truecolor.test ] && +if [ "$(basename "$0")" = "emulation-attributes-truecolor.test" ] && ! tmux_check 2 3; then printf "tmux does not support true color\n" >&2 exit 77 fi # Need 2.4 for BCE support -if [ "$(basename "$0")" = emulation-attributes-bce.test ] && +if [ "$(basename "$0")" = "emulation-attributes-bce.test" ] && ! tmux_check 2 4; then printf "tmux does not support BCE\n" >&2 exit 77 fi # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline direct verify exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi test_true_color() { s=$(printf "\033[0") - for i in $@; do + for i in "$@"; do s="$s;$i" done s="${s}m" @@ -50,7 +50,7 @@ test_true_color() r=$((255-(attr*255/76))) g=$((attr*510/76)) b=$((attr*255/76)) - if [ $g -gt 255 ]; then + if [ "$g" -gt 255 ]; then g=$((510-g)) fi invr=$((255-r)) @@ -59,8 +59,8 @@ test_true_color() c="E" printf "%s" "$s" - printf "\033[48;2;%d;%d;%dm" $r $g $b; - printf "\033[38;2;%d;%d;%dm" $invr $invg $invb + printf "\033[48;2;%d;%d;%dm" "$r" "$g" "$b"; + printf "\033[38;2;%d;%d;%dm" "$invr" "$invg" "$invb" printf "%s\033[m" "$c" done printf "\n" @@ -80,7 +80,7 @@ baseline() # Traditional ancient VT100 attributes. vt100) for attr in 0 1 4 5 7; do - printf '\033[%dmE\033[m ' $attr + printf '\033[%dmE\033[m ' "$attr" done ;; # 16-color attributes. diff --git a/src/tests/emulation-back-tab.test b/src/tests/emulation-back-tab.test index 3b24357a4..62bee4c66 100755 --- a/src/tests/emulation-back-tab.test +++ b/src/tests/emulation-back-tab.test @@ -8,13 +8,13 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline post exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi diff --git a/src/tests/emulation-cursor-motion.test b/src/tests/emulation-cursor-motion.test index 40ea8b9f7..aadb3d5a4 100755 --- a/src/tests/emulation-cursor-motion.test +++ b/src/tests/emulation-cursor-motion.test @@ -9,13 +9,13 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline direct verify exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi diff --git a/src/tests/emulation-multiline-scroll.test b/src/tests/emulation-multiline-scroll.test index af0309a0e..43424391b 100755 --- a/src/tests/emulation-multiline-scroll.test +++ b/src/tests/emulation-multiline-scroll.test @@ -11,13 +11,13 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi diff --git a/src/tests/emulation-scroll.test b/src/tests/emulation-scroll.test index 1656cadd3..02bbdffda 100755 --- a/src/tests/emulation-scroll.test +++ b/src/tests/emulation-scroll.test @@ -10,13 +10,13 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline post exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi diff --git a/src/tests/emulation-wrap-across-frames.test b/src/tests/emulation-wrap-across-frames.test index 576041840..69eeb68db 100755 --- a/src/tests/emulation-wrap-across-frames.test +++ b/src/tests/emulation-wrap-across-frames.test @@ -13,13 +13,13 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline direct verify exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi diff --git a/src/tests/network-no-diff.test b/src/tests/network-no-diff.test index 8aa4f15ad..93adc6179 100755 --- a/src/tests/network-no-diff.test +++ b/src/tests/network-no-diff.test @@ -9,13 +9,13 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline post exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi @@ -23,7 +23,7 @@ baseline() { # Generate updates that don't change the screen i=0 - while [ $i -lt 10 ] && printf 'x\b' && sleep 1; do + while [ "$i" -lt 10 ] && printf 'x\b' && sleep 1; do i=$((i + 1)) done } diff --git a/src/tests/prediction-unicode.test b/src/tests/prediction-unicode.test index bbb675c09..ce4659782 100755 --- a/src/tests/prediction-unicode.test +++ b/src/tests/prediction-unicode.test @@ -29,7 +29,7 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" tmux baseline mosh-args post exit fi @@ -76,10 +76,10 @@ post() unset LC_ALL unset LC_CTYPE unset LANGUAGE - ! env LANG=C egrep -q "%output %0 (\)|$(printf \\374))" "$(basename "$0").d/baseline.tmux.log" + ! env LANG=C grep -E -q "%output %0 (\)|$(printf \\374))" "$(basename "$0").d/baseline.tmux.log" # Implicit exitcode return. ) - return $? + return "$?" } case $1 in diff --git a/src/tests/pty-deadlock.test b/src/tests/pty-deadlock.test index 219eca947..292d48429 100755 --- a/src/tests/pty-deadlock.test +++ b/src/tests/pty-deadlock.test @@ -15,7 +15,7 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" tmux baseline post exit fi @@ -33,7 +33,7 @@ tmux_commands() # Restart output... printf "send-keys 0x11\n" sleep 10 - # And stop the test script, so it produces its exit messge. + # And stop the test script, so it produces its exit message. printf "send-keys 0x0d\n" # This will get killed by SIGPIPE. while printf "show-options\n" && sleep 1; do @@ -59,10 +59,10 @@ baseline() : done & printpid=$! - (sleep 120; kill $$ $printpid) & + (sleep 120; kill "$$" "$printpid") & killpid=$! read -r x - kill $printpid + kill "$printpid" # Try and make sure the printer stops writing before the following printf sleep 1 printf "\n=== normal exit ===\n" @@ -70,7 +70,7 @@ baseline() # before we exit sleep 4 # Kill the killer and exit normally. - kill $killpid + kill "$killpid" } post() diff --git a/src/tests/repeat.test b/src/tests/repeat.test index 7830c8e81..deb367dba 100755 --- a/src/tests/repeat.test +++ b/src/tests/repeat.test @@ -15,7 +15,7 @@ PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then do_tmux= case $(basename "$0" .test) in repeat-with-input) @@ -28,15 +28,15 @@ fi # Run mosh repeatedly client() { - for i in $(seq 1 $REPEAT_TEST_LOOPCOUNT); do - (sleep 15; kill $$) & + for i in $(seq 1 "$REPEAT_TEST_LOOPCOUNT"); do + (sleep 15; kill "$$") & killpid=$! if ! "$@"; then printf "### iteration %d failed\n" "$i" - kill $killpid + kill "$killpid" exit 1 fi - kill $killpid + kill "$killpid" done } @@ -69,7 +69,7 @@ baseline() post() { - if [ "$(grep -c "@@@ done" "$(basename "$0").d/baseline.tmux.log")" -lt $REPEAT_TEST_LOOPCOUNT ]; then + if [ "$(grep -c "@@@ done" "$(basename "$0").d/baseline.tmux.log")" -lt "$REPEAT_TEST_LOOPCOUNT" ]; then exit 1 fi } diff --git a/src/tests/server-network-timeout.test b/src/tests/server-network-timeout.test index 5de601d54..d28ecfe66 100755 --- a/src/tests/server-network-timeout.test +++ b/src/tests/server-network-timeout.test @@ -18,7 +18,7 @@ TIMEOUT=10 . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" client baseline exit fi @@ -48,11 +48,11 @@ client() fail "mosh-client had a normal exit\n";; # test condition failed 9|137|265) # Aha, signal 9. Wait. - sleep $(( TIMEOUT + 12 )) + sleep "$(( TIMEOUT + 12 ))" exit 0 ;; *) - fail "unknown client wrapper failure, retval=%d\n" $retval + fail "unknown client wrapper failure, retval=%d\n" "$retval" ;; esac fail "client wrapper shouldnt get here\n" @@ -82,11 +82,11 @@ baseline() case "$myname" in server-network-timeout) # Just wait. This is the hardest part. - sleep $(( TIMEOUT + 7 )) + sleep "$(( TIMEOUT + 7 ))" ;; server-signal-timeout) # Wait for the timeout to expire. - sleep $(( TIMEOUT + 2 )) + sleep "$(( TIMEOUT + 2 ))" # Tell the server to go away. kill -USR1 "$MOSH_SERVER_PID" sleep 5 diff --git a/src/tests/unicode-combine-fallback-assert.test b/src/tests/unicode-combine-fallback-assert.test index 4185e0248..1324613fd 100755 --- a/src/tests/unicode-combine-fallback-assert.test +++ b/src/tests/unicode-combine-fallback-assert.test @@ -12,13 +12,13 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi diff --git a/src/tests/unicode-later-combining.test b/src/tests/unicode-later-combining.test index a1ca0ad3f..5fa673d54 100755 --- a/src/tests/unicode-later-combining.test +++ b/src/tests/unicode-later-combining.test @@ -18,13 +18,13 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" baseline post exit fi # OK, we have arguments, we're one of the test hooks. -if [ $# -ne 1 ]; then +if [ "$#" -ne 1 ]; then fail "bad arguments %s\n" "$@" fi diff --git a/src/tests/window-resize.test b/src/tests/window-resize.test index a31025e93..8fcd2aec5 100755 --- a/src/tests/window-resize.test +++ b/src/tests/window-resize.test @@ -10,7 +10,7 @@ . "$(dirname "$0")/e2e-test-subrs" PATH=$PATH:.:$srcdir # Top-level wrapper. -if [ $# -eq 0 ]; then +if [ "$#" -eq 0 ]; then e2e-test "$0" tmux baseline exit fi