HeaderTesting

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

HeaderTesting

Simon Drouin
Hi all,

Is there documentation about header include rules somewhere? 

One of my questions: some of my HeaderTest fail because there is more than one include in the header, even though many header files in VTK include more than one header without generating an error. For example, I have a header file with those includes:

#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkObject.h"
#include "vtkNew.h"

which causes the test to fail. But many other header files have even more, e.g. vtkVolumeProperty.h:

#include "vtkNew.h" // Needed for vtkNew
#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkObject.h"

and do not fail the HeaderTesting. 

Does the order matter? The test report says there are 2 includes, not counting "vtkRenderingCoreModule.h", I guess this one is never included in the count? There must be something obvious here that I don't see, but what?

Thanks in advance.

s.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers

Reply | Threaded
Open this post in threaded view
|

Re: HeaderTesting

VTK - Dev mailing list
Not sure about the documentation (other than looking at the test code).
But for that specific problem, only one include is allowed that doesn't have a comment after it explaining why it is included. So just add short comments, that is the trick.

On Mon, Mar 18, 2019 at 9:42 AM Simon Drouin <[hidden email]> wrote:
Hi all,

Is there documentation about header include rules somewhere? 

One of my questions: some of my HeaderTest fail because there is more than one include in the header, even though many header files in VTK include more than one header without generating an error. For example, I have a header file with those includes:

#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkObject.h"
#include "vtkNew.h"

which causes the test to fail. But many other header files have even more, e.g. vtkVolumeProperty.h:

#include "vtkNew.h" // Needed for vtkNew
#include "vtkRenderingCoreModule.h" // For export macro
#include "vtkObject.h"

and do not fail the HeaderTesting. 

Does the order matter? The test report says there are 2 includes, not counting "vtkRenderingCoreModule.h", I guess this one is never included in the count? There must be something obvious here that I don't see, but what?

Thanks in advance.

s.
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers



--
Ken Martin PhD
Distinguished Engineer
Kitware Inc.
101 East Weaver Street
Carrboro, North Carolina
27510 USA

This communication, including all attachments, contains confidential and legally privileged information, and it is intended only for the use of the addressee.  Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken in reliance on it is prohibited and may be unlawful. If you received this communication in error please notify us immediately and destroy the original message.  Thank you.

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Search the list archives at: http://markmail.org/search/?q=vtk-developers

Follow this link to subscribe/unsubscribe:
https://vtk.org/mailman/listinfo/vtk-developers