From ece9b018215a59a0470195d45760a671311d29df Mon Sep 17 00:00:00 2001 From: Ralf Schandl Date: Sun, 29 Oct 2023 09:08:58 +0100 Subject: [PATCH] Mention yash in script-test/README.md Also minor changes in run.sh --- .gitignore | 1 + script-test/README.md | 1 + script-test/run.sh | 17 ++++++++++------- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index db1e525..d88b0b0 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ target/ .idea/ *.add.spl *.profraw +*.log diff --git a/script-test/README.md b/script-test/README.md index 6579c26..26a876a 100644 --- a/script-test/README.md +++ b/script-test/README.md @@ -20,6 +20,7 @@ If installed the following shells are used for testing: * zsh * mksh * pdksh +* yash * dash * sh diff --git a/script-test/run.sh b/script-test/run.sh index 3cc6c92..64f1f4d 100755 --- a/script-test/run.sh +++ b/script-test/run.sh @@ -6,7 +6,6 @@ script_name="$(basename "$0")" script_dir="$(cd "$(dirname "$0")" && pwd)" || exit 1 - cd "$script_dir" || exit 1 echo "Test Environment: $(uname -a)" @@ -16,11 +15,7 @@ case "$(uname -s | tr '[:upper:]' '[:lower:]')" in IS_CYGWIN=TRUE export IS_CYGWIN ;; - *msys*) - IS_MSYS=TRUE - export IS_MSYS - ;; - *mingw*) + *msys* | *mingw*) IS_MSYS=TRUE export IS_MSYS ;; @@ -49,6 +44,10 @@ get_shell_version() esac } +# +# Run tests with shell +# $1: The shell to execute +# $2...: The shell dialect to test test_with_shell() { unset TEST_SHELL @@ -76,7 +75,10 @@ test_with_shell() } -get_supported_shell_dialects() +# +# Determine the native dialect of the shell. Might be none. +# $1: The shell +get_supported_shell_dialect() { bn_sh=$(basename "$1") @@ -131,6 +133,7 @@ for sh in $test_shells; do # shellcheck disable=SC2086 # native_dialect _should_ split test_with_shell "$sh" $native_dialect sh else + # only test 'sh' mode test_with_shell "$sh" sh fi [ -n "$quick" ] && break