Преглед на файлове

Include static analysis in tests

Bob Mottram преди 7 години
родител
ревизия
1de2c88d04
променени са 1 файла, в които са добавени 25 реда и са изтрити 0 реда
  1. 25
    0
      src/freedombone-tests

+ 25
- 0
src/freedombone-tests Целия файл

@@ -65,6 +65,30 @@ function test_app_function_type {
65 65
     fi
66 66
 }
67 67
 
68
+function test_static_analysis {
69
+    FILES="/usr/share/${PROJECT_NAME}/apps/${PROJECT_NAME}-*"
70
+
71
+    for filename in $FILES
72
+    do
73
+        if ! shellcheck --exclude SC2034,SC1090 "$filename"; then
74
+            echo ''
75
+            echo $"${filename} failed static analysis"
76
+            exit 24687242
77
+        fi
78
+    done
79
+
80
+    FILES="/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-*"
81
+
82
+    for filename in $FILES
83
+    do
84
+        if ! shellcheck --exclude SC2034,SC1090 "$filename"; then
85
+            echo ''
86
+            echo $"${filename} failed static analysis"
87
+            exit 24687242
88
+        fi
89
+    done
90
+}
91
+
68 92
 function test_app_functions {
69 93
     if [ $RUN_STIG ]; then
70 94
         return
@@ -1255,6 +1279,7 @@ if [ ! "$RUN_STIG" ]; then
1255 1279
 fi
1256 1280
 
1257 1281
 test_app_functions
1282
+test_static_analysis
1258 1283
 test_unique_onion_ports
1259 1284
 remove_management_engine_interface
1260 1285
 freedombone-pass --test yes