I sent a pull request containing the unit tests for layers and line patterns dialogs today.
During creation of these unit tests I saw the compilation of main.cpp is taking too much time. It's because every test is written as a .h file and included in main.cpp.
The solution is to change .h files to .cpp and include them in CMakeLists.txt, which will make them compile separately.