[Development] A better headersclean test
Olivier Goffart
olivier at woboq.com
Thu Dec 18 11:43:09 CET 2014
On Wednesday 17 December 2014 19:57:47 Thiago Macieira wrote:
> Hello all
>
> I've previously mentioned this, but I can't find the link in the archives.
>
> I've implemented a better headersclean check that can't be forgotten. You
> can find it at https://codereview.qt-project.org/45533
>
> This email is to ask for when it should be enabled: Lars and Ossi in the
> mail discussion requested it be disabled by default. I think it should be
> enabled alongside developer-build and it should have an option to turn off,
> like the one for -warnings-are-errors (-no-warnings-are-errors) which
> applies to the *.cpp files.
>
> The reason I am asking for this is because having our own headers be clean
> of warnings is a feature. And just like our binary compatibility
> guarantees, it should be tested and enforced in the CI, which in turn
> requires everyone to know whether they're introducing warnings or not.
>
> But I'll be happy if this gets enabled in the CI.
>
>
> Features:
> 1) unlike the previous solution, this does not require adding a unit test,
> which only 9 out of 25 modules had
>
> 2) unlike the previous solution, this compiles each header independently,
> thus catching any mistakes that could have been hidden by another header
> getting included first
>
> 3) headers that should not be tested can be skipped by adding
> #pragma qt_sync_skip_header_check
> though outside of QtCore, you should really not be doing this
>
> 4) if a debug-and-release build is active, this applies only to the release
> build (with many compilers, especially GCC, warnings are often the result of
> optimisations)
+1, headersclean is important. It was very useful in the past, too bad it was
removed.
>
> Drawback:
> It increases the build time considerably (25 to 33%) due to having a lot
> more files to compile, and always without PCH.
That's a bit annoying.
Maybe we should still group some headers.
--
Olivier
Woboq - Qt services and support - http://woboq.com - http://code.woboq.org
More information about the Development
mailing list