Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TEST_CASE_CLASS is broken in v2.4.8 #608

Open
BerengerBerthoul opened this issue Feb 3, 2022 · 1 comment · May be fixed by #702
Open

TEST_CASE_CLASS is broken in v2.4.8 #608

BerengerBerthoul opened this issue Feb 3, 2022 · 1 comment · May be fixed by #702

Comments

@BerengerBerthoul
Copy link
Contributor

BerengerBerthoul commented Feb 3, 2022

Description

TEST_CASE_CLASS works with version 2.4.7, not with v2.4.8. It is broken by commit 95a7853.

Steps to reproduce

TEST_CASE_CLASS is not documented nor tested by the CI. However if I take this example proposed in the description of the feature, and simplify it :

#include "doctest/doctest.h"

class my_type {
    int data = 5;

    TEST_CASE_CLASS("all_to_all_v 2") {
        my_type local;
        CHECK(local.data == 2);
    }
};

This does not compile. GCC error message:

doctest.h:1980:64: error: 'DOCTEST_ANON_VAR_4' was not declared in this scope; did you mean 'DOCTEST_ANON_VAR_0'?
1980 |     global_prefix DOCTEST_GLOBAL_NO_WARNINGS(DOCTEST_ANONYMOUS(DOCTEST_ANON_VAR_), 

Extra information

Note that a (better?) alternative to TEST_CASE_CLASS is mentioned here. Maybe we should try to implement the more flexible feature rather than fixing this one.

On a personal note, I was just trying to check if TEST_CASE_CLASS could solve my problem (a bug in MPI_TEST_CASE with several SUBCASE). But it will not (even when fixed). So I personally don't need the fix.

  • doctest version: v2.4.8
  • Operating System: Linux
  • Compiler+version: GCC 11
@Saalvage Saalvage linked a pull request Oct 3, 2022 that will close this issue
1 task
This was linked to pull requests Oct 4, 2022
This was unlinked from pull requests Oct 4, 2022
@Saalvage Saalvage linked a pull request Oct 4, 2022 that will close this issue
1 task
@avoirtech
Copy link

There is also an issue with the TEST_CASE_CLASS with templates, see here: #718

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants