all.sh: cleaned up usage output

This commit is contained in:
Gilles Peskine 2017-12-10 23:43:39 +01:00
parent 7ad603e662
commit 709346aed8

View File

@ -56,22 +56,28 @@ fi
usage()
{
printf "Usage: $0\n"
printf " -h|--help\t\tPrint this help.\n"
printf " -m|--memory\t\tAdditional optional memory tests.\n"
printf " -f|--force\t\tForce the tests to overwrite any modified files.\n"
printf " -s|--seed\t\tInteger seed value to use for this test run.\n"
printf " -r|--release-test\t\tRun this script in release mode. This fixes the seed value to 1.\n"
printf " --no-yotta\t\tSkip yotta build\n"
printf " --out-of-source-dir=<path>\t\tDirectory used for CMake out-of-source build tests."
printf " --openssl=<OpenSSL_path>\t\tPath to OpenSSL executable to use for most tests.\n"
printf " --openssl-legacy=<OpenSSL_path>\t\tPath to OpenSSL executable to use for legacy tests e.g. SSLv3.\n"
printf " --gnutls-cli=<GnuTLS_cli_path>\t\tPath to GnuTLS client executable to use for most tests.\n"
printf " --gnutls-serv=<GnuTLS_serv_path>\t\tPath to GnuTLS server executable to use for most tests.\n"
printf " --gnutls-legacy-cli=<GnuTLS_cli_path>\t\tPath to GnuTLS client executable to use for legacy tests.\n"
printf " --gnutls-legacy-serv=<GnuTLS_serv_path>\t\tPath to GnuTLS server executable to use for legacy tests.\n"
printf " --armc5-bin-dir=<ARMC5_bin_dir_path>\t\tPath to the ARM Compiler 5 bin directory.\n"
printf " --armc6-bin-dir=<ARMC6_bin_dir_path>\t\tPath to the ARM Compiler 6 bin directory.\n"
cat <<EOF
Usage: $0 [OPTION]...
-h|--help Print this help.
General options:
-f|--force Force the tests to overwrite any modified files.
-m|--memory Additional optional memory tests.
--no-yotta Skip yotta build.
--out-of-source-dir=<path> Directory used for CMake out-of-source build tests.
-r|--release-test Run this script in release mode. This fixes the seed value to 1.
-s|--seed Integer seed value to use for this test run.
Tool path options:
--armc5-bin-dir=<ARMC5_bin_dir_path> ARM Compiler 5 bin directory.
--armc6-bin-dir=<ARMC6_bin_dir_path> ARM Compiler 6 bin directory.
--gnutls-cli=<GnuTLS_cli_path> GnuTLS client executable to use for most tests.
--gnutls-serv=<GnuTLS_serv_path> GnuTLS server executable to use for most tests.
--gnutls-legacy-cli=<GnuTLS_cli_path> GnuTLS client executable to use for legacy tests.
--gnutls-legacy-serv=<GnuTLS_serv_path> GnuTLS server executable to use for legacy tests.
--openssl=<OpenSSL_path> OpenSSL executable to use for most tests.
--openssl-legacy=<OpenSSL_path> OpenSSL executable to use for legacy tests e.g. SSLv3.
EOF
}
# remove built files as well as the cmake cache/config
@ -127,42 +133,21 @@ check_tools()
while [ $# -gt 0 ]; do
case "$1" in
--memory|-m*)
MEMORY=${1#-m}
--armc5-bin-dir)
shift
ARMC5_BIN_DIR="$1"
;;
--armc6-bin-dir)
shift
ARMC6_BIN_DIR="$1"
;;
--force|-f)
FORCE=1
;;
--seed|-s)
shift
SEED="$1"
;;
--release-test|-r)
RELEASE=1
;;
--no-yotta)
YOTTA=0
;;
--out-of-source-dir)
shift
OUT_OF_SOURCE_DIR="$1"
;;
--openssl)
shift
OPENSSL="$1"
;;
--openssl-legacy)
shift
OPENSSL_LEGACY="$1"
;;
--gnutls-cli)
shift
GNUTLS_CLI="$1"
;;
--gnutls-serv)
shift
GNUTLS_SERV="$1"
;;
--gnutls-legacy-cli)
shift
GNUTLS_LEGACY_CLI="$1"
@ -171,17 +156,43 @@ while [ $# -gt 0 ]; do
shift
GNUTLS_LEGACY_SERV="$1"
;;
--armc5-bin-dir)
--gnutls-serv)
shift
ARMC5_BIN_DIR="$1"
GNUTLS_SERV="$1"
;;
--armc6-bin-dir)
shift
ARMC6_BIN_DIR="$1"
;;
--help|-h|*)
--help|-h)
usage
exit 1
exit
;;
--memory|-m)
MEMORY=1
;;
--no-yotta)
YOTTA=0
;;
--openssl)
shift
OPENSSL="$1"
;;
--openssl-legacy)
shift
OPENSSL_LEGACY="$1"
;;
--out-of-source-dir)
shift
OUT_OF_SOURCE_DIR="$1"
;;
--release-test|-r)
RELEASE=1
;;
--seed|-s)
shift
SEED="$1"
;;
*)
echo >&2 "Unknown option: $1"
echo >&2 "Run $0 --help for usage."
exit 120
;;
esac
shift