basdesigner.blogg.se

Visual studio code coverage cl
Visual studio code coverage cl







The official Clang binaries for Windows do ship without the necessary libraries and programs to create a clang-AST based tool. This is probably the time to tell you more about the difficulties of the Windows build for a clang-AST-based tool. Lld-link: error: could not open 'D:\cppinsights\current\lib\clang\10.0.0\lib/windows\clang_rt.profile-x86_64.lib': no such file or directoryĪs always, the linker was right. Boy, was I wrong! I always remind my students that there is another step after compiling, linking! The beloved lld-link.exe told me at the end of the build: I was so certain that I was only minutes away from pushing this great change to GitHub. It compiled! It is all about the right tools in place It took me a couple of attempts to figure out how I have to configure clang-cl to work without MSBuild and which flags I have to pass to generate code coverage information. Ok, it turned out that I used MSBuild for a reason.

visual studio code coverage cl

Should you know better, please let me know! Changing road's: Using only clang-clĪs the road with MSBuild turned out to be a dead-end, I came up with the brilliant idea to use only clang-cl. I also tried to pass clang-cl.exe as a linker to CMake.

visual studio code coverage cl

I concluded that due to the crazy setup on Windows, using MSBuild together with clang-cl.exe to invoke the Clang-compiler but map and filter all the Windows options, passing -coverage was not supported. MSVC or better, MSBuild told me that it doesn't know the option /-coverage. Ok, I stopped being so happy after the first compilation attempt.

visual studio code coverage cl

Yes, I know that was a little overstating, but I was happy. I also went crazy and added the flag only for the Windows platform. What else could I dream of? Adding -coverage in the CMakeLists.txt was a piece of cake. Exactly what I was looking for and in a single flag. Under Windows, clang-cl.exe got a new option -coverage. The idea was fueled by this article code-coverage-with-clang-on-windows.html. It seemed like a logical choice to use it on Windows as well. Clang is able to perform code coverage analysis on Linux and macOS. My next attempt was to use what I already know, Clang. While MSVC offers code coverage analysis, I couldn't get that information out in a gcov-like format.

visual studio code coverage cl

The start of the journey: MSBuild and clang-cl In the what's next section, I dreamed a little about getting code coverage information from the Windows build. In my last post, I wrote about the switch from Travis CI to GitHub Actions ( C++ Insights: From Travis CI to GitHub Actions.









Visual studio code coverage cl