From 1de2c88d04716c0daf8d878818813d02cae7c005 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 2 Mar 2018 19:34:44 +0000 Subject: [PATCH] Include static analysis in tests --- src/freedombone-tests | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/freedombone-tests b/src/freedombone-tests index 04370b07..37443af4 100755 --- a/src/freedombone-tests +++ b/src/freedombone-tests @@ -65,6 +65,30 @@ function test_app_function_type { fi } +function test_static_analysis { + FILES="/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-*" + + for filename in $FILES + do + if ! shellcheck --exclude SC2034,SC1090 "$filename"; then + echo '' + echo $"${filename} failed static analysis" + exit 24687242 + fi + done + + FILES="/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-*" + + for filename in $FILES + do + if ! shellcheck --exclude SC2034,SC1090 "$filename"; then + echo '' + echo $"${filename} failed static analysis" + exit 24687242 + fi + done +} + function test_app_functions { if [ $RUN_STIG ]; then return @@ -1255,6 +1279,7 @@ if [ ! "$RUN_STIG" ]; then fi test_app_functions +test_static_analysis test_unique_onion_ports remove_management_engine_interface freedombone-pass --test yes