Skip to content

Commit

Permalink
selftests: ktap_helpers: Make it POSIX-compliant
Browse files Browse the repository at this point in the history
There are a couple uses of bash specific syntax in the script. Change
them to the equivalent POSIX syntax. This doesn't change functionality
and allows non-bash test scripts to make use of these helpers.

Reported-by: Mike Looijmans <mike.looijmans@topic.nl>
Closes: https://lore.kernel.org/all/efae4037-c22a-40be-8ba9-7c1c12ece042@topic.nl/
Fixes: 2dd0b5a ("selftests: ktap_helpers: Add a helper to finish the test")
Fixes: 14571ab ("kselftest: Add new test for detecting unprobed Devicetree devices")
Signed-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
Reviewed-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
  • Loading branch information
nfraprado authored and shuahkh committed May 6, 2024
1 parent c7e8470 commit 45d5a2b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/testing/selftests/kselftest/ktap_helpers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ __ktap_test() {
directive="$3" # optional

local directive_str=
[[ ! -z "$directive" ]] && directive_str="# $directive"
[ ! -z "$directive" ] && directive_str="# $directive"

echo $result $KTAP_TESTNO $description $directive_str

Expand Down Expand Up @@ -99,7 +99,7 @@ ktap_exit_fail_msg() {
ktap_finished() {
ktap_print_totals

if [ $(("$KTAP_CNT_PASS" + "$KTAP_CNT_SKIP")) -eq "$KSFT_NUM_TESTS" ]; then
if [ $((KTAP_CNT_PASS + KTAP_CNT_SKIP)) -eq "$KSFT_NUM_TESTS" ]; then
exit "$KSFT_PASS"
else
exit "$KSFT_FAIL"
Expand Down

0 comments on commit 45d5a2b

Please sign in to comment.