vscode-cmake-tools icon indicating copy to clipboard operation
vscode-cmake-tools copied to clipboard

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

Open redstrate opened this issue 1 year ago • 2 comments

This change addresses item #4116

This changes visible test output

The following changes are proposed:

  • Change the test output message when encountering an error exit code.
  • Check for skipped tests and mark them as skipped.

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 avatar Oct 15 '24 17:10 redstrate

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

redstrate avatar Oct 15 '24 17:10 redstrate

@redstrate This looks great!

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

Done!

redstrate avatar Oct 16 '24 21:10 redstrate