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

[bug] test cases can end up in the wrong test suite #91

Closed
onqtam opened this issue Sep 20, 2017 · 1 comment
Closed

[bug] test cases can end up in the wrong test suite #91

onqtam opened this issue Sep 20, 2017 · 1 comment

Comments

@onqtam
Copy link
Member

onqtam commented Sep 20, 2017

A test case can end up in the wrong test suite because of a function being marked as inline instead of static - consider the following code:

// a.cpp
#include <doctest.h>
TEST_SUITE("some test suite") {
    TEST_CASE("aaa") { CHECK(0); }
}
// b.cpp
#include <doctest.h>
TEST_SUITE("test suite in  b.cpp") {
    TEST_CASE("bbb") { CHECK(0); }
}
// main.cpp
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
#include <doctest.h>

When these 3 files are built and linked there will be 2 test cases registered, but both will be in the same test suite.

Caught this while reviewing my slides for CppCon 2017!!!

onqtam added a commit that referenced this issue Sep 20, 2017
@onqtam
Copy link
Member Author

onqtam commented Sep 20, 2017

darn - smart commits dont work!!!

@onqtam onqtam closed this as completed Sep 20, 2017
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

No branches or pull requests

1 participant