We have to automatically build unit tests as well. The problem is that quite often, the main function is provided by the test framework itself. Also depending on the test framework, compilation of unit tests might required specific linkage or preprocessor definitions.