Rename dismiss_test to skip_tests since test won't even run in this case

This commit is contained in:
Charles Herlin 2019-02-14 17:52:45 +01:00
parent 47a818b832
commit bad32f8078
3 changed files with 7 additions and 6 deletions

View File

@ -1,6 +1,6 @@
# run-shellcheck # run-shellcheck
test_audit() { test_audit() {
dismiss_test skip_tests
# shellcheck disable=2154 # shellcheck disable=2154
run genconf /opt/debian-cis/bin/hardening/"${script}".sh --audit-all run genconf /opt/debian-cis/bin/hardening/"${script}".sh --audit-all

View File

@ -24,7 +24,7 @@ tests_list=""
testno=0 testno=0
testcount=0 testcount=0
dismiss_test=0 skip_tests=0
dismiss_count=0 dismiss_count=0
nbfailedret=0 nbfailedret=0
nbfailedgrep=0 nbfailedgrep=0
@ -69,8 +69,9 @@ get_stdout()
clear_registered_tests() { clear_registered_tests() {
unset REGISTERED_TESTS unset REGISTERED_TESTS
declare -a REGISTERED_TESTS declare -a REGISTERED_TESTS
# shellcheck disable=2034
dismiss_count=0 dismiss_count=0
dismiss_test=0 skip_tests=0
} }
# Generates a formated test name # Generates a formated test name
@ -84,7 +85,7 @@ make_usecase_name() {
# Plays the registered test suite # Plays the registered test suite
play_registered_tests() { play_registered_tests() {
if [ "$dismiss_test" -eq 1 ]; then if [ "$skip_tests" -eq 1 ]; then
return return
fi fi
usecase_name=$1 usecase_name=$1

View File

@ -67,9 +67,9 @@ contain()
} }
# Do not run tests at all for the next `run` # Do not run tests at all for the next `run`
dismiss_test() { skip_tests() {
# shellcheck disable=2034 # shellcheck disable=2034
dismiss_test=1 skip_tests=1
} }
# test is expected to fail (for instance on blank system) # test is expected to fail (for instance on blank system)