Ensure a UTF-8 locale is available for tests
Fixes Debian sid schroot build. Also add build deps required for full testing: tmux, less (for window-resize.test)
This commit is contained in:
Vendored
+1
-1
@@ -2,7 +2,7 @@ Source: mosh
|
|||||||
Section: net
|
Section: net
|
||||||
Priority: optional
|
Priority: optional
|
||||||
Maintainer: Keith Winstein <keithw@mit.edu>
|
Maintainer: Keith Winstein <keithw@mit.edu>
|
||||||
Build-Depends: debhelper (>= 9), autotools-dev, protobuf-compiler, libprotobuf-dev, dh-autoreconf, pkg-config, libutempter-dev, zlib1g-dev, libncurses5-dev, libssl-dev, bash-completion
|
Build-Depends: debhelper (>= 9), autotools-dev, protobuf-compiler, libprotobuf-dev, dh-autoreconf, pkg-config, libutempter-dev, zlib1g-dev, libncurses5-dev, libssl-dev, bash-completion, locales, tmux, less
|
||||||
Standards-Version: 3.9.8
|
Standards-Version: 3.9.8
|
||||||
Homepage: https://mosh.org
|
Homepage: https://mosh.org
|
||||||
Vcs-Git: https://github.com/mobile-shell/mosh.git
|
Vcs-Git: https://github.com/mobile-shell/mosh.git
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
. "$(dirname "$0")/e2e-test-subrs"
|
||||||
|
|
||||||
#
|
#
|
||||||
# Validate that mosh produces expected output, using screen captures
|
# Validate that mosh produces expected output, using screen captures
|
||||||
# in tmux.
|
# in tmux.
|
||||||
@@ -106,6 +108,9 @@ mosh_server()
|
|||||||
}
|
}
|
||||||
|
|
||||||
# main
|
# main
|
||||||
|
if ! set_locale; then
|
||||||
|
test_error "e2e-test: no usable locale\n"
|
||||||
|
fi
|
||||||
|
|
||||||
# Set up environment
|
# Set up environment
|
||||||
if [ -z "$srcdir" ]; then
|
if [ -z "$srcdir" ]; then
|
||||||
|
|||||||
@@ -54,3 +54,24 @@ chr()
|
|||||||
{
|
{
|
||||||
printf '%b' "\\0$(printf %03o "$1")"
|
printf '%b' "\\0$(printf %03o "$1")"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# If the locale is not set to a UTF-8 locale, set it to en_US.UTF-8
|
||||||
|
# or C.UTF-8.
|
||||||
|
set_locale()
|
||||||
|
{
|
||||||
|
# Test for a usable locale.
|
||||||
|
map=$(locale charmap 2>/dev/null)
|
||||||
|
if [ "$map" = "utf-8" ] || [ "$map" = "UTF-8" ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
# Attempt to find/set a usable locale.
|
||||||
|
for i in en_US.UTF-8 en_US.utf8 C.UTF-8; do
|
||||||
|
map="$(env LANG=$i locale charmap 2>/dev/null)"
|
||||||
|
if [ "$map" = "utf-8" ] || [ "$map" = "UTF-8" ]; then
|
||||||
|
export LANG=$i LC_ALL=''
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
# Fail.
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,4 +1,11 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
. "$(dirname "$0")/e2e-test-subrs"
|
||||||
|
if ! set_locale; then
|
||||||
|
echo "$0: no usable locale" >&2
|
||||||
|
exit 99
|
||||||
|
fi
|
||||||
|
|
||||||
set -eu
|
set -eu
|
||||||
out=$(
|
out=$(
|
||||||
TERM=xterm \
|
TERM=xterm \
|
||||||
|
|||||||
Reference in New Issue
Block a user