浏览代码

Include static analysis in tests

Bob Mottram 7 年前
父节点
当前提交
1de2c88d04
共有 1 个文件被更改,包括 25 次插入0 次删除
  1. 25
    0
      src/freedombone-tests

+ 25
- 0
src/freedombone-tests 查看文件

65
     fi
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
 function test_app_functions {
92
 function test_app_functions {
69
     if [ $RUN_STIG ]; then
93
     if [ $RUN_STIG ]; then
70
         return
94
         return
1255
 fi
1279
 fi
1256
 
1280
 
1257
 test_app_functions
1281
 test_app_functions
1282
+test_static_analysis
1258
 test_unique_onion_ports
1283
 test_unique_onion_ports
1259
 remove_management_engine_interface
1284
 remove_management_engine_interface
1260
 freedombone-pass --test yes
1285
 freedombone-pass --test yes