everyone.
In my specific Clion project, I have several cpp Unit Tests files (google tests), each of them with its main. I'm searching a way to run all unit tests of the project in a easy way. In this moment, I'm only able to run each target separately and I don't want to create a unique main for all tests.
OBS: The cpp unit test files is organizing in different folders inside of a "tests" folder.
How can anyone help me?
Note that CLion simply uses CMake to drive the build.
Adding Google Test to your project txt file inside the Google_tests folder: right-click it in the project tree and select New | CMakeLists. txt. In your root CMakeLists. txt script, add the add_subdirectory(Google_tests) command to the end, then reload the project.
The issue the OP referred to is that there are multiple targets that incorporate the binaries. The Google Test control only allows a single target. The answer is to use Compound execution.
First, review this concept, if unfamiliar: https://www.jetbrains.com/help/clion/creating-and-editing-run-debug-configurations.html
Second, follow these steps:
Steps:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With