Make tests detect UTF-8 locale with a helper executable

This uses the same utility function that mosh-client/mosh-server do.
This resolves portability issues with the 'locale' command.
This fixes OpenBSD 6.0 and probably Haiku builds.
This commit is contained in:
John Hood
2017-03-20 10:49:16 -04:00
parent 0f0301b746
commit 654f269917
5 changed files with 62 additions and 13 deletions
+9 -8
View File
@@ -108,10 +108,6 @@ mosh_server()
}
# main
if ! set_locale; then
test_error "e2e-test: no usable locale\n"
fi
# Set up environment
if [ -z "$srcdir" ]; then
export srcdir=$PWD
@@ -137,10 +133,6 @@ case "$(basename "$0")" in
;;
esac
if ! tmux_check; then
test_skipped "tmux unavailable\n"
fi
if [ $# -lt 2 ]; then
test_error "not enough args\n"
fi
@@ -153,6 +145,15 @@ test_args=$@
test_dir=$(basename "${test_name}").d
test_script="${test_name}"
tests_dir=$(dirname "${test_name}")
if ! set_locale "${tests_dir}"; then
test_error "e2e-test: no usable locale\n"
fi
if ! tmux_check; then
test_skipped "tmux unavailable\n"
fi
rm -rf "${test_dir}"
mkdir "${test_dir}"