Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple maintenance improvements #1148

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions COPYING
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -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 <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

Expand All @@ -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
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.

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
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/licenses/why-not-lgpl.html>.
50 changes: 0 additions & 50 deletions appveyor.sh

This file was deleted.

54 changes: 0 additions & 54 deletions appveyor.yml

This file was deleted.

2 changes: 1 addition & 1 deletion macosx/brew-deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ install()
{
# Straight from https://brew.sh
if ! brew --version > /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
}

Expand Down
2 changes: 1 addition & 1 deletion macosx/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/wrap-compiler-for-flag-check
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ if out=$("$@" 2>&1); then
else
code=$?
echo "$out"
exit $code
exit "$code"
fi
2 changes: 1 addition & 1 deletion src/tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/tests/e2e-failure.test
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/tests/e2e-success.test
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
24 changes: 12 additions & 12 deletions src/tests/e2e-test
Original file line number Diff line number Diff line change
Expand Up @@ -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")"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -113,7 +113,7 @@ case "$(basename "$0")" in
;;
esac

if [ $# -lt 2 ]; then
if [ "$#" -lt 2 ]; then
test_error "not enough args\n"
fi

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
20 changes: 10 additions & 10 deletions src/tests/e2e-test-server
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -55,22 +55,22 @@ 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.
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
Expand All @@ -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
10 changes: 5 additions & 5 deletions src/tests/e2e-test-subrs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -95,7 +95,7 @@ tmux_check()
fi
fi
version=$(tmux -V)
if [ $? != 0 ]; then
if [ "$?" != 0 ]; then
error "tmux unavailable\n"
return 1
fi
Expand All @@ -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"
}
Loading