# Inherit VTK's exclusions. We don't have to redefine them in this file anymore.
set(paraview_use_external_vtk "@PARAVIEW_USE_EXTERNAL_VTK@")
if (NOT paraview_use_external_vtk)
  include("${CMAKE_CURRENT_LIST_DIR}/VTK/CTestCustom.cmake")
endif ()

# Regular expression for warning exception during build process
list(APPEND CTEST_CUSTOM_WARNING_EXCEPTION
  # Ignore `getenv` "deprecation" with MSVC.
  "vtknvindex_utilities.h.*: warning C4996: 'getenv'"

  # Ignore protobuf-generated source file warnings.
  "vtkPVMessage.pb.cc"

  # ignore warning from string_fortified.h inclusion
  "string_fortified.h"

  # Unreachable code in xutility causes C4702 warnings in MSVC.
  "xutility.*unreachable code"

  # exclude warnings from dmfile.cxx
  "dmfile.*"

  # exclude warnings from unreference NewInstance function
  ".*NewInstance.*was declared but never referenced"

  # Intel compiler warning about routines being both inline and noinline
  "warning #2196.* routine is both"

  # compiler optimizations may sometimes lead to this warning
  "assuming signed overflow does not occur when assuming that"

  # Visual Studio STL warnings.
  "VC.Tools.*include.*: warning"

  # Doxygen warning exclusions
  "<unknown>:1: warning: no matching .* member found for"
  "vtkPVMessage.pb.h:.*: warning: no.*matching class member found for"
  "paraview/tpl/cinemasci/viewers/readme.md:10: warning: unable to resolve reference to `doc/readme_view.md' for"
  "warning: unable to resolve reference to `https:' for \ref command"
  "md:.*: warning:" # Disable all warnings in .md files

  # warnings from moc generated code
  "_autogen"

  # deprecation notes
  "note: declared here"
)

list(APPEND CTEST_CUSTOM_ERROR_EXCEPTION
  # Xcb error does not seem to cause errors in generated test images
  "qt.qpa.xcb: internal error"
  # Qt lupdate writes warning on stderr when finding class as template types
  "Ignoring definition of undeclared qualified class"
)

# Regular expression for excluding files from coverage testing
list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE
  ".*/VTK/.*"
  "vtk[^\\.]+ClientServer.cxx"
  "vtk[^\\.]+Python.cxx"
  "ui_[^\\.]+.h"
  "moc_[^\\.]+.h"
  "vtkprotobuf")
