1 # -*- coding: utf-8 -*-
18 "deqp/modules/candytest",
22 "deqp/modules/gles31",
24 "deqp/modules/glshared",
25 "deqp/modules/glusecases",
26 "deqp/modules/opencl",
27 "deqp/modules/internal",
28 "deqp/framework/qphelper",
29 "deqp/framework/common",
31 "deqp/framework/opengl",
32 "deqp/framework/opencl",
33 "deqp/framework/platform",
34 "deqp/framework/randomshaders",
35 "deqp/framework/referencerenderer",
36 "deqp/wrappers/dynlib",
37 "deqp/wrappers/gles3",
47 "deqp/wrappers/dynlib/inc",
48 "deqp/wrappers/gles3/inc",
49 "deqp/modules/gles2/accuracy",
50 "deqp/modules/gles2/functional",
51 "deqp/modules/gles2/performance",
52 "deqp/modules/gles2/stress",
53 "deqp/modules/gles2/usecases",
54 "deqp/modules/gles3/accuracy",
55 "deqp/modules/gles3/functional",
56 "deqp/modules/gles3/stress",
57 "deqp/modules/gles3/usecases",
58 "deqp/modules/gles3/performance",
59 "deqp/modules/gles31/functional",
60 "deqp/modules/gles31/stress",
61 "deqp/modules/gl3/functional",
62 "deqp/modules/gl3/performance",
63 "deqp/modules/gl3/stress",
64 "deqp/framework/opengl/simplereference",
65 "deqp/framework/opencl/inc",
66 "deqp/framework/opengl/wrapper",
67 "deqp/framework/opengl/simplereference",
93 "-DDE_COMPILER=1", # Is preprocessor buggy in recent cppcheck?
99 "-DDEQP_SUPPORT_GLES2=1",
100 "-DDEQP_SUPPORT_GLES3=1",
101 "-DDEQP_SUPPORT_OPENCL=1",
102 "-DDEQP_SUPPORT_OPENGL=1",
103 "-DDEQP_TARGET_NAME=\"Cppcheck\"",
104 "-D_XOPEN_SOURCE=600",
105 "--suppress=arrayIndexOutOfBounds:deqp/framework/common/tcuVector.hpp",
106 "--suppress=invalidPointerCast:deqp/framework/common/tcuTexture.cpp",
107 "--suppress=*:deqp/framework/opencl/cl.hpp",
108 "--suppress=invalidPointerCast:deqp/modules/opencl/tclSIRLogger.cpp",
109 "--suppress=preprocessorErrorDirective:deqp/framework/platform/android/tcuAndroidMain.cpp",
110 "--suppress=invalidPointerCast:deqp/modules/gles3/functional/es3fTransformFeedbackTests.cpp",
111 "--suppress=invalidPointerCast:deqp/modules/gles3/functional/es3fUniformBlockCase.cpp",
112 "--suppress=unusedStructMember",
113 "--suppress=postfixOperator",
114 "--suppress=unusedFunction",
115 "--suppress=unusedPrivateFunction",
116 "--rule-file=deqp/scripts/no_empty_fail.rule"
119 def runCppCheck (srcBaseDir, dstFile):
120 fullDstFile = os.path.realpath(dstFile)
121 command = '"C:\\Program Files (x86)\\Cppcheck\\cppcheck.exe"'
123 for arg in ARGS + ["--xml"]:
124 command += " %s" % arg
126 for path in INCLUDE_DIRS:
127 command += " -I %s" % path
129 for path in SRC_DIRS:
130 command += " %s" % path
132 command += ' 2> "%s"' % fullDstFile
135 os.system('"%s"' % command) # Double-quotes needed for some reason
137 if __name__ == "__main__":
138 if len(sys.argv) != 2:
139 print "%s: [reportfile]" % sys.argv[0]
142 dstFile = sys.argv[1]
143 srcDir = os.path.realpath(os.path.normpath(os.path.join(os.path.dirname(__file__), "..", "..")))
144 runCppCheck(srcDir, dstFile)