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_SUPPORT_GLES2=1",
120 "-DDEQP_SUPPORT_GLES3=1",
121 "-DDEQP_SUPPORT_OPENCL=1",
122 "-DDEQP_SUPPORT_OPENGL=1",
123 "-DDEQP_TARGET_NAME=\"Cppcheck\"",
124 "-D_XOPEN_SOURCE=600",
125 "--suppress=arrayIndexOutOfBounds:deqp/framework/common/tcuVector.hpp",
126 "--suppress=invalidPointerCast:deqp/framework/common/tcuTexture.cpp",
127 "--suppress=*:deqp/framework/opencl/cl.hpp",
128 "--suppress=invalidPointerCast:deqp/modules/opencl/tclSIRLogger.cpp",
129 "--suppress=preprocessorErrorDirective:deqp/framework/platform/android/tcuAndroidMain.cpp",
130 "--suppress=invalidPointerCast:deqp/modules/gles3/functional/es3fTransformFeedbackTests.cpp",
131 "--suppress=invalidPointerCast:deqp/modules/gles3/functional/es3fUniformBlockCase.cpp",
132 "--suppress=unusedStructMember",
133 "--suppress=postfixOperator",
134 "--suppress=unusedFunction",
135 "--suppress=unusedPrivateFunction",
136 "--rule-file=deqp/scripts/no_empty_fail.rule"
139 def runCppCheck (srcBaseDir, dstFile):
140 fullDstFile = os.path.realpath(dstFile)
141 command = '"C:\\Program Files (x86)\\Cppcheck\\cppcheck.exe"'
143 for arg in ARGS + ["--xml"]:
144 command += " %s" % arg
146 for path in INCLUDE_DIRS:
147 command += " -I %s" % path
149 for path in SRC_DIRS:
150 command += " %s" % path
152 command += ' 2> "%s"' % fullDstFile
155 os.system('"%s"' % command) # Double-quotes needed for some reason
157 if __name__ == "__main__":
158 if len(sys.argv) != 2:
159 print "%s: [reportfile]" % sys.argv[0]
162 dstFile = sys.argv[1]
163 srcDir = os.path.realpath(os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..")))
164 runCppCheck(srcDir, dstFile)