[Development] A better headersclean test

Thiago Macieira thiago.macieira at intel.com
Thu Dec 18 04:57:47 CET 2014


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)

Drawback:
It increases the build time considerably (25 to 33%) due to having a lot more 
files to compile, and always without PCH.
-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Development mailing list