-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Discussion] Speed up compilation of C++ tests #10049
Comments
Just out of curiosity, can you please include your compilation profiling output? |
Here only core and linear solvers are compiled (from greater time to lower time, with ninja_log_analyser):
|
I used doctest for CoSimIO I like it a lot |
@philbucher I tried to contact you by private, I don't know if I have your e-mail right. Can you please contact me? |
I've never used
|
The advantage is not using exceptions which take a lot oc ompilation time (that's why the cpp tests take so long to compile despite being moderately small)
The idea would be to refactor existing macros so the code doesn't need to be changed
Where have you read that? |
I have been looking and I did not found anything related with that. Maybe you are confusing with python doctest (https://docs.python.org/3/library/doctest.html), is not the same |
Uhm, yeah that's possible, I just skimmed over the first few google hits 🤦 |
I sent you an email :) |
@KratosMultiphysics/technical-committee approves the #11506, choosing the GTest. The reason was the maturity and the completeness of the GTest in comparison with doctest. |
Description
@KratosMultiphysics/technical-committee
When you use some utility to analyse the compilation's times in Kratos (see https://opensource.adobe.com/lagrange-docs/dev/compilation-profiling/ or https://github.com/ginolatorilla/ninja-log-analyser) some things you will realize are:
If you do some research, you will find that this is due to the mechanics we use for the C++ tests. We use catch (we thought errors). This is quite compilation time-consuming. And there are many error checks in the C++ tests (one per each check).
In my previous job, as there wasn't any C++ test system I did some research and the most efficient after many trial and error was the library called doctest:
https://github.com/doctest/doctest
I even have a custom implementation of the library, as this library only implements a check, so for advance checks you must implement manually. In the library, you can see it mimics the Kratos checks:
https://github.com/loumalouomega/MACROdoctest
Long time ago I started the implementation in Kratos, but I couldn't dedicate time to finish it: https://github.com/KratosMultiphysics/Kratos/tree/external_lib/doc_test, now maybe could be a good time to retake it.
Essentially is that, I think it would help to minimize the long compilations times, apart from the typical techniques (separate source and header, reduce number of includes, etc...)
The text was updated successfully, but these errors were encountered: