Skip to content

Commit 45d5a2b

Browse files
nfrapradoshuahkh
authored andcommitted
selftests: ktap_helpers: Make it POSIX-compliant
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 <[email protected]> Closes: https://lore.kernel.org/all/[email protected]/ 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 <[email protected]> Reviewed-by: Muhammad Usama Anjum <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent c7e8470 commit 45d5a2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/kselftest/ktap_helpers.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ __ktap_test() {
4343
directive="$3" # optional
4444

4545
local directive_str=
46-
[[ ! -z "$directive" ]] && directive_str="# $directive"
46+
[ ! -z "$directive" ] && directive_str="# $directive"
4747

4848
echo $result $KTAP_TESTNO $description $directive_str
4949

@@ -99,7 +99,7 @@ ktap_exit_fail_msg() {
9999
ktap_finished() {
100100
ktap_print_totals
101101

102-
if [ $(("$KTAP_CNT_PASS" + "$KTAP_CNT_SKIP")) -eq "$KSFT_NUM_TESTS" ]; then
102+
if [ $((KTAP_CNT_PASS + KTAP_CNT_SKIP)) -eq "$KSFT_NUM_TESTS" ]; then
103103
exit "$KSFT_PASS"
104104
else
105105
exit "$KSFT_FAIL"

0 commit comments

Comments
 (0)