1 # -*- coding: utf-8 -*-
3 #-------------------------------------------------------------------------
4 # drawElements Quality Program utilities
5 # --------------------------------------
7 # Copyright 2015 The Android Open Source Project
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
13 # http://www.apache.org/licenses/LICENSE-2.0
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
21 #-------------------------------------------------------------------------
38 "deqp/modules/candytest",
42 "deqp/modules/gles31",
44 "deqp/modules/glshared",
45 "deqp/modules/glusecases",
46 "deqp/modules/opencl",
47 "deqp/modules/internal",
48 "deqp/framework/qphelper",
49 "deqp/framework/common",
51 "deqp/framework/opengl",
52 "deqp/framework/opencl",
53 "deqp/framework/platform",
54 "deqp/framework/randomshaders",
55 "deqp/framework/referencerenderer",
56 "deqp/wrappers/dynlib",
57 "deqp/wrappers/gles3",
67 "deqp/wrappers/dynlib/inc",
68 "deqp/wrappers/gles3/inc",
69 "deqp/modules/gles2/accuracy",
70 "deqp/modules/gles2/functional",
71 "deqp/modules/gles2/performance",
72 "deqp/modules/gles2/stress",
73 "deqp/modules/gles2/usecases",
74 "deqp/modules/gles3/accuracy",
75 "deqp/modules/gles3/functional",
76 "deqp/modules/gles3/stress",
77 "deqp/modules/gles3/usecases",
78 "deqp/modules/gles3/performance",
79 "deqp/modules/gles31/functional",
80 "deqp/modules/gles31/stress",
81 "deqp/modules/gl3/functional",
82 "deqp/modules/gl3/performance",
83 "deqp/modules/gl3/stress",
84 "deqp/framework/opengl/simplereference",
85 "deqp/framework/opencl/inc",
86 "deqp/framework/opengl/wrapper",
87 "deqp/framework/opengl/simplereference",
105 "--enable=all,style",
113 "-DDE_COMPILER=1", # Is preprocessor buggy in recent cppcheck?
119 "-DDEQP_TARGET_NAME=\"Cppcheck\"",
120 "-D_XOPEN_SOURCE=600",
121 "--suppress=arrayIndexOutOfBounds:deqp/framework/common/tcuVector.hpp",
122 "--suppress=invalidPointerCast:deqp/framework/common/tcuTexture.cpp",
123 "--suppress=*:deqp/framework/opencl/cl.hpp",
124 "--suppress=invalidPointerCast:deqp/modules/opencl/tclSIRLogger.cpp",
125 "--suppress=preprocessorErrorDirective:deqp/framework/platform/android/tcuAndroidMain.cpp",
126 "--suppress=invalidPointerCast:deqp/modules/gles3/functional/es3fTransformFeedbackTests.cpp",
127 "--suppress=invalidPointerCast:deqp/modules/gles3/functional/es3fUniformBlockCase.cpp",
128 "--suppress=unusedStructMember",
129 "--suppress=postfixOperator",
130 "--suppress=unusedFunction",
131 "--suppress=unusedPrivateFunction",
132 "--rule-file=deqp/scripts/no_empty_fail.rule"
135 def runCppCheck (srcBaseDir, dstFile):
136 fullDstFile = os.path.realpath(dstFile)
137 command = '"C:\\Program Files (x86)\\Cppcheck\\cppcheck.exe"'
139 for arg in ARGS + ["--xml"]:
140 command += " %s" % arg
142 for path in INCLUDE_DIRS:
143 command += " -I %s" % path
145 for path in SRC_DIRS:
146 command += " %s" % path
148 command += ' 2> "%s"' % fullDstFile
151 os.system('"%s"' % command) # Double-quotes needed for some reason
153 if __name__ == "__main__":
154 if len(sys.argv) != 2:
155 print "%s: [reportfile]" % sys.argv[0]
158 dstFile = sys.argv[1]
159 srcDir = os.path.realpath(os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..")))
160 runCppCheck(srcDir, dstFile)