From b1b9b75a2d8041e1c2234f7448c61f8468a4258d Mon Sep 17 00:00:00 2001 From: Munif Tanjim Date: Mon, 9 Dec 2024 20:51:26 +0600 Subject: [PATCH] chore: fix test script output --- scripts/test.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/scripts/test.sh b/scripts/test.sh index 649f755..9a51385 100755 --- a/scripts/test.sh +++ b/scripts/test.sh @@ -9,18 +9,18 @@ declare test_scope="${module}" while [[ $# -gt 0 ]]; do case "${1}" in - --clean) - shift - echo "[test] cleaning up environment" - rm -rf "${plugins_dir}" - echo "[test] envionment cleaned" - ;; - *) - if [[ "${test_scope}" == "${module}" ]] && [[ "${1}" == "${module}/"* ]]; then - test_scope="${1}" - fi - shift - ;; + --clean) + shift + echo "[test] cleaning up environment" + rm -rf "${plugins_dir}" + echo "[test] envionment cleaned" + ;; + *) + if [[ "${test_scope}" == "${module}" ]] && [[ "${1}" == "${module}/"* ]]; then + test_scope="${1}" + fi + shift + ;; esac done @@ -78,9 +78,9 @@ luacov_start declare test_logs="" if [[ -d "./tests/${test_scope}/" ]]; then - test_logs=$(nvim --headless --noplugin -u tests/init.lua -c "lua require('plenary.test_harness').test_directory('./tests/${test_scope}/', { minimal_init = 'tests/init.lua', sequential = true })") + test_logs=$(nvim --headless --noplugin -u tests/init.lua -c "lua require('plenary.test_harness').test_directory('./tests/${test_scope}/', { minimal_init = 'tests/init.lua', sequential = true })" || true) elif [[ -f "./tests/${test_scope}_spec.lua" ]]; then - test_logs=$(nvim --headless --noplugin -u tests/init.lua -c "lua require('plenary.busted').run('./tests/${test_scope}_spec.lua')") + test_logs=$(nvim --headless --noplugin -u tests/init.lua -c "lua require('plenary.busted').run('./tests/${test_scope}_spec.lua')" || true) fi echo "${test_logs}"