question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests marked may_fail etc. are shown as failed (red cross)

See original GitHub issue

I am running test cases with doctest that are marked may_fail, should_fail or expected_failures. The asserts within those tests fail, but the test is considered passed due to the decorator. (There is an equivalent feature in Catch called “tags”) In the Test UI, such tests are shown/considered as failed (red cross), when they should be considered as successful (green check). Ideally, this would show some third status indicating that such a decorator was in play (yellow check?), but I don’t know if this is supported upstream.

See for example these doctest tests:

TEST_CASE("expected failures" * doctest::expected_failures(1))
{
   REQUIRE(false);
}
TEST_CASE("may fail" * doctest::may_fail())
{
   REQUIRE(false);
}
TEST_CASE("should fail" * doctest::should_fail())
{
   REQUIRE(false);
}

The output of running such tests in the command line shows the following summary:

[doctest] test cases: 3 | 3 passed | 0 failed | 26 skipped
[doctest] assertions: 3 | 0 passed | 3 failed |
[doctest] Status: SUCCESS!

but in the Test UI I only get red checkmarks: grafik

  • Extension Version:
  • VS Code Version: 1.60.0
  • Catch2 / Google Test / DOCTest Version: doctest 2.4.6
  • OS Type and Version: Windows 10
  • Using remote-ssh/docker/wsl?: no
  • I don’t think that this situtation has been considered so far, so I didn’t think a log would be that useful.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
matepekcommented, Dec 9, 2021

In case of Catch2 they have. Technically it is possible but I guess it’s a bigger investment, would be.

0reactions
onqtamcommented, Dec 9, 2021

@matepek

Also it would be great if a doctest issue was opened about reporting the result of SubCases. Don’t know the result of them.

Hmmm, subcases are just {} blocks after if() statements generated from the macros - no return code, and there’s no counting & reporting of failed assertions in subcases, so they don’t have a result.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Feature] Better integration with tools (VS Code Test Adapter ...
The "Catch2 and Google Test Explorer" Extension for Visual Studio Code has ... Tests marked may_fail etc. are shown as failed (red cross) ......
Read more >
The Competency Exam consists of a Skills Test and a Written ...
RECEIVING TEST RESULTS. The Competency Exam consists of a Skills Test and a Written Test. Exam results will Not be given at the...
Read more >
Exam Information and Study Guide | Red Cross
SKILLS TEST RESULTS - The emailed report will show PASS or FAIL ... Department of Public Health and your examination will be scored...
Read more >
Frequently Asked Questions | American Red Cross
Frequently asked questions (FAQ's) about the American Red Cross. Find all your answers here!
Read more >
Training Services Frequently Asked Questions - Red Cross
Find answers to your questions about health, safety, and preparedness training and certification in the Red Cross Training Services FAQ.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found