microsoft / vscode-cmake-tools

CMake integration in Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=vector-of-bool.cmake-tools
MIT License
1.48k stars 453 forks source link

Improve test case failure/skip states and their output (#4116) #4129

Closed redstrate closed 1 week ago

redstrate commented 1 month ago

This change addresses item #4116

This changes visible test output

The following changes are proposed:

The purpose of this change

Currently if a test fails, it's not immediately clear why that is because we give the exit code - and not the output from ctest. That is now fixed and the ctest output is shown which greatly improves the usefulness of the Test Results pane and other places where this output is shown like Code Lens.

Skipped test cases were also not actually marked as skipped, and that is now fixed as well.

Other Notes/Information

Comparison screenshots to show the improvement:

Failed Tests

Before After
Screenshot_20241015_125716 Screenshot_20241015_125209

Skipped Tests

Before After
Screenshot_20241015_125700 Screenshot_20241015_125759

Unfortunately this google test example I used doesn't set test source location, but if it did then code lens would be affected as well like in this outdated screenshot from the issue:

image

redstrate commented 1 month ago

@microsoft-github-policy-service agree company="KDAB"

redstrate commented 1 month ago

@redstrate This looks great!

If you could please make a CHANGELOG entry, then we can approve and accept this PR! Thanks.

Done!