-
Notifications
You must be signed in to change notification settings - Fork 0
/
do_oclint
executable file
·56 lines (47 loc) · 1.37 KB
/
do_oclint
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
git_branch=`git rev-parse --abbrev-ref HEAD`
cpp_files=`ls *.cpp | egrep -v "^jaan_.*\.cpp$" | egrep -v "^qrc_.*\.cpp$" | egrep -v "^moc_.*\.cpp$" | egrep -v "^.*_test\.cpp$"`
echo ".cpp files that will be analysed: "$cpp_files
h_files=`ls *.h | egrep -v "^jaan_.*\.h$" | egrep -v "^ui_.*\.h$"`
echo ".h files that will be analysed: "$h_files
qt4_folder="usr/include/qt4/QtGui"
qt5_folder="usr/include/qt5/QtWidgets"
./oclint-0.10.3/bin/oclint -o oclint.log \
-disable-rule ShortVariableName \
$cpp_files \
$h_files \
-- \
-c -std=c++14 -fPIE \
-DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB \
-I../BoostGraphTutorial/BoostGraphTutorial \
-I../gausser \
-I../GSL/include/gsl \
-I../RibiLibraries/qwt-6.1/src \
-I../SurfacePlotter \
-I/usr/include/c++/5 \
-I/usr/include/x86_64-linux-gnu/c++/5 \
-I/usr/include/qt5 \
-I/usr/include/qt5/QtCore \
-I/usr/include/qt5/QtGui \
-I/usr/include/qt5/QtTest \
-I/usr/include/qt5/QtWidgets
cat oclint.log
# Will be 0 if success
# Will be 1 if fail
fail=`egrep "Compiler Errors" oclint.log | wc -l`
if [ $fail -eq 1 ];
then
echo "OCLint: Compiler error, can only be warnings :-("
else
echo "OCLint: OK"
fi
# Will be 1 if success
# Will be 0 if fail
success=`egrep "FilesWithViolations=0 P1=0 P2=0 P3=0" oclint.log | wc -l`
if [ $success -eq 1 ];
then
echo "OCLint: OK"
else
echo "OCLint: Fail"
exit 1
fi