Doctest C++ run configuration doesn't specify a target
已回答
I am currently evaluating CLion and I can not find a way to run a simple test with Doctest. The run configuration will not allow me to setup a target and the dialog displays this error: "Target is not specified". I am using Meson and Ninja as my build system and have followed this instructions:
https://wanzenbug.xyz/clion-meson-compiledb/
Regards,
Angelo
请先登录再写评论。
Hello!
Compilation database itself lacks the data required for building, running and debugging an application. However, you can set up the workflow by adding custom build targets for your compilation database project and creating custom Run/Debug configurations for these targets.
When you create a custom build target for your project, you can try specifying it in your Doctest configuration.
Hi Anna, thank you for your help. It is a good solution for my build environment with Meson and Ninja, I figured out how to set up the build configuration and target and am building my project with no issues. But still I lost the integration of CLion with Doctest, I can not run a specific test or explore the tests results. Under what circumstances, or with which project types, will Doctest be integrated with my project like in the link below?
https://blog.jetbrains.com/rscpp/2019/07/10/better-ways-testing-with-doctest/
Sorry for misleading, usage of custom build targets in Unit Test configurations is not yet supported - https://youtrack.jetbrains.com/issue/CPP-15158. Feel free to comment or upvote the issue. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.
For now Doctest integration in CLion (https://www.jetbrains.com/help/clion/doctest-support.html) works for CMake projects.
Hi Anna, I am glad having the custom build target to build my Meson projects, it speeds up the development cycle and CLion is proving to be a top notch IDE. Regarding the unit tests, I am able to run all of them as a custom build target and am satisfied with it. I will take a look at the issue you reported.
Cheers