diff options
| author | Petr Štetiar | 2019-11-01 09:26:38 +0000 |
|---|---|---|
| committer | Petr Štetiar | 2019-11-14 16:11:08 +0000 |
| commit | 38a2f12ec5abafda9b385b6ce9f68714349df264 (patch) | |
| tree | 6e6d4094312ed34f8d88c2bf71cd965b816cd6ed | |
| parent | 266fc9e94c1e56ca0544ce417fb919217623b1be (diff) | |
| download | uci-38a2f12ec5abafda9b385b6ce9f68714349df264.tar.gz | |
tests: shunit2: fix issues reported by shellcheck
In tests.sh line 10:
[ -x $UCI_BIN ] || {
^------^ SC2086: Double quote to prevent globbing and word splitting.
In tests.sh line 63:
for suite in $(ls ${SCRIPTS_DIR}/*)
^--------------------^ SC2045: Iterating over ls output is fragile. Use globs.
In tests.sh line 65:
cat ${suite} >> ${FULL_SUITE}
^------^ SC2086: Double quote to prevent globbing and word splitting.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
| -rwxr-xr-x | tests/shunit2/tests.sh | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/shunit2/tests.sh b/tests/shunit2/tests.sh index a7c6d90..72c4874 100755 --- a/tests/shunit2/tests.sh +++ b/tests/shunit2/tests.sh @@ -7,7 +7,7 @@ TMP_DIR=${TESTS_DIR}"/tmp" FULL_SUITE=${TESTS_DIR}"/full_suite.sh" UCI_BIN=${UCI_BIN:-"../uci"} -[ -x $UCI_BIN ] || { +[ -x "$UCI_BIN" ] || { echo "uci is not present." >&2 return 1 } @@ -60,9 +60,9 @@ assertFailWithNoReturn() { } EOF -for suite in $(ls ${SCRIPTS_DIR}/*) +for suite in "${SCRIPTS_DIR}"/* do - cat ${suite} >> ${FULL_SUITE} + cat "${suite}" >> ${FULL_SUITE} done echo ". ${DO_TEST}" >> ${FULL_SUITE} |