-
-
Notifications
You must be signed in to change notification settings - Fork 649
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
Add ability to filter subcases with filters #57
Comments
- the filters are "--subcase=" and "--subcase-exclude=" - there is also the option "--subcase-filter-levels=<int>" which affects which levels of nested subcases should check the filters
Given the following code: TEST_CASE("Test") {
cout << "root" << endl;
SUBCASE( "sa" ) {
cout << "sa" << endl;
SUBCASE( "sb" ) {
cout << "sb" << endl;
}
SUBCASE( "sc" ) {
cout << "sc" << endl;
}
}
SUBCASE( "sd" ) {
cout << "sd" << endl;
}
}
This is still in the dev branch though... |
how to execute only one leaf test case? for example sb-level1/sb-level-2/sb-level3 |
@iamviji in the example from this issue the following works to execute one specific leaf: |
Thanks. I have tried that. TEST_CASE("TC")
{
MESSAGE("TC");
SUBCASE("SB1")
{
MESSAGE("TC.SB1");
SUBCASE("SB1") { MESSAGE("TC.SB1.SB1"); }
SUBCASE("SB2") { MESSAGE("TC.SB1.SB2"); }
}
SUBCASE("SB2")
{
MESSAGE("TC.SB2");
SUBCASE("SB1") { MESSAGE("TC.SB2.SB1"); }
SUBCASE("SB2") { MESSAGE("TC.SB2.SB2"); }
}
} command tried: output: but I expect |
@iamviji there are identical subcase names which are nested within each other. Try with different names like this: TEST_CASE("TC")
{
MESSAGE("TC");
SUBCASE("SB1_root")
{
MESSAGE("TC.SB1_root");
SUBCASE("SB1") { MESSAGE("TC.SB1_root.SB1"); }
SUBCASE("SB2") { MESSAGE("TC.SB1_root.SB2"); }
}
SUBCASE("SB2_root")
{
MESSAGE("TC.SB2_root");
SUBCASE("SB1") { MESSAGE("TC.SB2_root.SB1"); }
SUBCASE("SB2") { MESSAGE("TC.SB2_root.SB2"); }
}
}
I guess this could be investigated and may be a little confusing... Or the docs should say that nested subcases shouldn't have identical names. |
I see |
No description provided.
The text was updated successfully, but these errors were encountered: