CTestCustom.cmake
Go to the documentation of this file.
1 set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_ERRORS 1000)
2 set(CTEST_CUSTOM_MAXIMUM_NUMBER_OF_WARNINGS 1000)
3 
4 list(APPEND CTEST_CUSTOM_MEMCHECK_IGNORE
5  # Issues in third party glut library
6  VTK::RenderingExternalCxx-TestGLUTRenderWindow
7  VTK::IOVPICCxx-TestVPICReader
8  VTK::RenderingFreeTypeFontConfigCxx-TestSystemFontRendering
9  VTK::GeovisGDALCxx-TestRasterReprojectionFilter
10 
11  # The PLY code does out of range ops but that is just how
12  # it is architected currently. It stores every value into
13  # uint, int, and double but typically only uses the
14  # value that makes sense for the type read in. Code needs
15  # to be reworked eventually but the out of range values
16  # are likely not being used.
17  VTK::IOPLYCxx-TestPLYWriter
18  VTK::IOPLYCxx-TestPLYWriterString
19  VTK::IOPLYCxx-TestPLYReaderTextureUVPoints
20  VTK::IOPLYCxx-TestPLYReaderTextureUVFaces
21 
22  # TestLinePlotDouble intentionally uses very large doubles
23  # even though the implementation of the class is largely
24  # float. Fixing this requires reworking a few classes to
25  # use doubles everywhere (which they generally should)
26  # when that is done this can be removed.
27  # The key classes impacted are vtkPlotPoints and the
28  # Draw calls in Context2D
29  VTK::ChartsCoreCxx-TestLinePlotDouble
30 
31  # loguru looks like it leaks the thread name but apparently
32  # it eventually does free the memory. See
33  # https://github.com/emilk/loguru/issues/132
34  # for some reason only this test seems to report it
35  VTK::FiltersParallelDIY2Cxx-TestRedistributeDataSetFilter
36 )
37 
38 list(APPEND CTEST_CUSTOM_WARNING_MATCH
39  "{standard input}:[0-9][0-9]*: Warning: ")
40 
41 list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
42  # classes that have been marked deprecated
43  # and will be removed in the future
44  # To be remove din VTK 9.0
45  "vtkTemporalStreamTracer"
46 
47  # Java compilation warnings that don't matter.
48  "^1 warning$"
49  "bootstrap class path not set in conjunction with -source"
50 
51  # OSX has deprecated openGL but we still use it
52  # and probably will not update the code but replace it
53  # with vulklan/moltenVK in the future
54  "Cocoa.*deprecated"
55  "NSOpenGL.*deprecated"
56 
57  # C4275 carries with it a note that we don't care about. std::exception is
58  # the main culprit here.
59  "vcruntime_exception.h.*: note: see declaration of 'std::exception'"
60 
61  # C4702 warning (unreachable code) caused by intentional abort() used
62  # in test which prevents the return statement from being called.
63  "TestLoggerDisableSignalHandler.*unreachable code"
64 
65  # GetVersion is deprecated, but its use is OK.
66  "sysinfoapi.h.*: note: see declaration of 'GetVersion'"
67 
68  # Suppress notes from template instantiation backtraces.
69  "note: see reference to (class|function) template instantiation"
70  "note: while compiling class template member function"
71 
72  # This is secondary output from clang, not indicating the warning per se.
73  "[0-9]* warnings? generated"
74  "note: \\(skipping [0-9]* expansions in backtrace"
75  "note: expanded from (here|macro)"
76 
77  # This is secondary output from MSVC, not indicate the warning per se.
78  "note: see declaration of"
79  "note: see previous definition of"
80 
81  # Ignore macro expansion lines from GCC
82  "note: in expansion of macro"
83 
84  # function cast in vtkLogger/loguru
85  "vtkLogger.cxx.*: warning: cast between incompatible function types"
86 
87  # Qt headers cause C4127 warnings with MSVC. Nothing we can do to fix them.
88  "[Qq]t([Cc]ore|[Gg]ui|[Tt]est|[Ww]idgets).*(warning|note)"
89  # Qt has some functions marked as `__forceinline` which MSVC refuses to inline.
90  "[Qq]t.*warning C4714"
91  "[Qq]t.*note: see declaration of"
92 
93  # Python notes triggered from MPI4Py Cython-generated code.
94  "include/python3.*: note:"
95 
96  # macOS warnings about dependencies htat are newer than the CI target
97  # version.
98  "ld: warning: dylib \\(/Applications/Xcode.*\\.app/Contents/Developer/Library/Frameworks/.*\\) was built for newer macOS version \\(.*\\) than being linked \\(.*\\)"
99 
100  # Warning notes from Xcode.
101  "/Applications/Xcode.*: note:"
102 
103  # Ignore moc-generated code (and rcc and uic).
104  "\\.dir[/\\\\][^/\\\\]*_autogen"
105 
106  # Intel compilers warn about large functions, but we don't usually care.
107  "remark #11074: Inlining inhibited by limit (max-total-size|max-size)"
108  # Ignore the suggestion line for more information too.
109  "remark #11076: To get full report use"
110 
111  # clang-tidy ignores
112  "vtkParse.tab.c.*bugprone-sizeof-expression"
113  "vtkParse.tab.c.*bugprone-suspicious-include"
114  "mocs_compilation.cpp.*bugprone-suspicious-include"
115  "vtkkwiml/test/test_.*: warning: .* \\[modernize-redundant-void-arg\\]"
116 
117  # Ignore warnings from the standard library.
118  "warning:.*__builtin_memcpy.*stringop-overflow="
119  "note: at offset .* into destination object"
120 
121  # Ignore some tidy warnings from wrapper code.
122  "vtk[^\\.]+(Java|Python).cxx:.*\\[(readability-redundant-string-init)\\]"
123 
124  # Ignore some doxygen warnings
125  "warning: documented symbol 'template class .*' was not declared or defined."
126  "vtkContext2D.h:.*: warning: argument '.*' of command @param is not found in the argument list of vtkContext2D::DrawMarkers"
127  "vtkMultiThreshold.h:.*: warning: argument '.*' of command @param is not found in the argument list of vtkMultiThreshold::AddIntervalSet"
128  "QQuickVTKRenderWindow.h:.*: warning: QQuickVTKRenderWindow::captureScreenshot has @param documentation sections but no arguments"
129  "vtkInherits.h:.*: warning: documented symbol 'static vtk::ParentClasses.*::value' was not declared or defined."
130  "vtkPolyhedron.h:.*: warning: vtkPolyhedron::GetCellFaces has @param documentation sections but no arguments"
131 
132  # Ignore bits from gcc-12 stdlib. There seem to be some serious issues in GCC
133  # 12 diagnostics. These come from the `quay.io/pypa/manylinux_2_28_x86_64`
134  # container as of now.
135  "/opt/rh/gcc-toolset-12"
136 
137  # GCC 10.1 contains a bugfix for an error in previous GCC versions that
138  # resulted in a class zero-sized subobject to be passed incorrectly when
139  # compiled as C++17 or C++20 in versions of GCC prior to 10.1. GCC 10.1 fixes
140  # this by forcing the C++14 implementation and issuing a warning.
141  "when C\\+\\+17 is enabled changed to match C\\+\\+14 in GCC 10.1"
142 
143  # Spurious warning from libxml2. The variable is initialized under the same
144  # predicate it is used.
145  "vtklibxml2/dict.c:[0-9]+:[0-9]+: warning: variable 'plen' may be used uninitialized when used here \\[-Wconditional-uninitialized\\]"
146  "exodusII/vtkexodusII/src/ex_put_one_attr.c:[0-9]+:[0-9]+: note: initialize the variable 'obj_id_ndx' to silence this warning"
147  )
148 
149 set(cdash_show_third_party_warnings "")
150 if (NOT cdash_show_third_party_warnings)
151  list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
152  # issue with exodus but exodus is not included in the note
153  # should these issues get fixed in exodus then remove this
154  # suppression
155  "note: '__builtin___snprintf_chk'"
156 
157  # HDF5 lex/yacc sources compilation lacks the "ThirdParty" part of the path.
158  "hl/src/H5LT(parse|analyze)"
159 
160  # Suppress ThirdParty source code from displaying warnings.
161  "[Tt]hird[Pp]arty"
162 
163  # Suppress MetaIO warnings.
164  "MetaIO/vtkmetaio"
165 
166  # clang will often give multiline warnings from macro expansions,
167  # where the first part has "warning:" and subsequent parts have "note:"
168  # and those will sometimes expand into systems headers. When this occurs
169  # for ThirdParty code, we want it suppressed too. Do so here for headers within Xcode.
170  "Xcode\\.app/Contents/Developer.+note:"
171 
172  # Suppress Remote module source code from displaying warnings.
173  # Suppress modules individually as just "Remote" is a common pattern
174  "[Rr]emote.[Mm]oment[Ii]nvariants"
175  "[Rr]emote.[Pp]oisson[Rr]econstruction"
176  "[Rr]emote.[Pp]owercrust"
177 
178  # sometimes we use system third party headers with issues
179  # in this case liblas
180  "include/liblas"
181 
182  # in this case a redefinition of strndup between netcdf and
183  # /usr/include/x86_64-linux-gnu/bits/string2.h but the warning
184  # does not include ThirdParty in the line
185  "bits/string2\\.h"
186 
187  # some windows link warnings related to hdf5 that do not include
188  # ThirdParty in the message
189  "H5.*\\.c\\.obj : warning LNK4221"
190 
191  # ThirdParty xdmf2 uses sbrk which has been marked deprecated but
192  # produces a warning without ThirdParty ala
193  # /usr/include/unistd.h:587:7: note: 'sbrk' has been explicitly marked deprecated here
194  "note: 'sbrk' has been explicitly marked deprecated here"
195 
196  # libproj source code includes the line
197  # return 0; /* suppresses a warning */
198  # which is listed as context for another warning
199  # and causes a match due to the work warning in it
200  "return 0; /\\* suppresses a warning \\*/"
201 
202  # boost graph lib causes a warning on gcc with code that
203  # boost uses internally. An example for you template fans is
204  # /source/Infovis/BoostGraphAlgorithms/Testing/Cxx/TestBoostAdapter.cxx:221:47: warning: '*((void*)(& ei)+32).__gnu_cxx::__normal_iterator<boost::detail::stored_edge_property<long unsigned int, boost::property<boost::edge_index_t, unsigned int> >*, std::vector<boost::detail::stored_edge_property<long unsigned int, boost::property<boost::edge_index_t, unsigned int> >, std::allocator<boost::detail::stored_edge_property<long unsigned int, boost::property<boost::edge_index_t, unsigned int> > > > >::_M_current' may be used uninitialized in this function [-Wmaybe-uninitialized]
205  "[Bb]oost[Gg]raph.*edge_property.*may be used uninitialized"
206 
207  # Boost.Graph uses deprecated Boost headers internally.
208  "define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior"
209 
210  # Boost.Math is C++14; ignore warnings for now.
211  "boost/math/tools/config.hpp.*: warning: .*minimum language standard"
212 
213  # Warnings due to DIY
214  "xmemory.*: warning C4996:.*Default Bounds constructor"
215 
216  # viskores uses deprecated TBB headers
217  "TBB Warning: tbb/task.h is deprecated"
218 
219  # viskores related warnings, someone working on viskores should fix these and once fixed
220  # remove these suppressions
221  "struct VISKORES_DEPRECATED"
222  "viskores::filter"
223 
224  # eigen uses this internal header from CUDA that should not be used.
225  # [-Wcpp]
226  "host_defines.h is an internal header file and must not be used directly. This file will be removed in a future CUDA release. Please use cuda_runtime_api.h or cuda_runtime.h instead"
227 
228  # warnings from moc generated code such as
229  # GUISupport/Qt/GUISupportQt_autogen/EWIEGA46WW/moc_QVTKInteractorInternal.cpp:73:55: warning: redundant parentheses surrounding declarator [-Wredundant-parens]
230  "autogen.*moc.*redundant parentheses"
231  # GUISupport/Qt/GUISupportQt_autogen/EWIEGA46WW/moc_QFilterTreeProxyModel.cpp:40:5: warning: 'StringRefStorage' may not intend to support class template argument deduction [-Wctad-maybe-unsupported]
232  "autogen.*moc.*ctad-maybe-unsupported"
233 
234  # third party hdf5
235  # if(NULL == (*full_name = (char *)H5MM_malloc(path1_len + path2_len + 2 + 2))) /* Extra "+2" to quiet GCC warning - 2019/07/05, QAK */
236  "H5MM.*quiet GCC warning"
237 
238  # Ignore diy2 warnings
239  "vtkdiy2"
240 
241  # missing overrides may be suppressed, but the superclass shows up as a match on some systems
242  # it makes no sense to suppress the offending class but report the superclass
243  # vtkPolyDataAlgorithm.h:91:3: note: overridden virtual function is here
244  "note: overridden virtual function is here"
245 
246  # Warnings from template instantiations. Remove once cmake/cmake!4766 is releasted.
247  "x(memory0|utility)\\([0-9]+\\): warning C4244"
248 
249  # Timeout errors of SCCACHE are common cases for long builds such as VTK+Viskores+CUDA
250  "sccache: warning: The server looks like it shut down unexpectedly, compiling locally instead"
251 
252  # Ignore warnings from Apple's new linker about duplicate rpath flags.
253  "ld: warning: duplicate -rpath"
254 
255  # Libxml2 has an ignored warning in a line with a string containing `warning`
256  "xmlVFormatLegacyError.*validity warning"
257 
258  # Suppress deprecated CUB Swap function warning suggesting cuda::std::swap
259  "cub::CUB_[0-9]+_SM_[0-9]+::Swap.*deprecated.*cuda::std::swap"
260  )
261 endif ()
262 
263 # CI-specific warning suppressions.
264 #
265 # Some of our CI ends up generating warnings that don't really matter. Of
266 # particular interest are warnings which have different behavior in older
267 # compilers than modern ones. It's not really all that important to cater to
268 # old, broken warning implementations when newer compilers tell us when we
269 # aren't doing things properly.
270 if (NOT "$ENV{CI}" STREQUAL "")
271  # Warning exclusions for old compilers and dependencies.
272  if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "mindeps")
273  # GCC 8.0.0
274  if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "el7")
275  list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
276  # Deprecated classes trigger "usage" warnings in methods marked with
277  # either `= default` or `= delete` generated implementations. This is not
278  # helpful, so just ignore them all.
279  "Wdeprecated-declarations"
280  )
281  endif ()
282  endif ()
283 
284  # For some reason, warning flags aren't working here.
285  if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "_ext_vtk")
286  list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
287  "Wstringop-overflow="
288  "note: destination object allocated here"
289  "note: destination object '.*' of size .*"
290 
291  "Wstringop-overread"
292  "allocated by 'operator new'"
293  "note: source object '.*' of size .*"
294  "note: at offset .* into source object '.*' of size .*"
295  )
296  endif ()
297  if ("$ENV{CMAKE_CONFIGURATION}" MATCHES "wasm")
298  list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
299  # Emscripten tends to use bleeding edge versions of clang.
300  # Suppress warnings from clang's c++ headers about deprecated features.
301  "note: '[a-z]?strstream' has been explicitly marked deprecated here"
302  "note: 'char_traits<vtkfmt::detail::char8_type>' has been explicitly marked deprecated here"
303  "warning: 'char_traits<vtkfmt::detail::char8_type>' is deprecated"
304  )
305  endif ()
306 endif ()
307 
308 list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
309  "vtk[^\\.]+(Java|Python).cxx"
310  ".*Testing.Cxx.*cxx"
311  ".*Testing.Cxx.*h"
312  ".*moc_.*cxx"
313 
314  # Exclude files from the Utilities directories
315  ".*/Utilities/.*"
316  ".*/ThirdParty/.*")
version