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 cases with datasets and fixtures don't support flexible fixture interface. #203

Closed
dudamoos opened this Issue Feb 8, 2019 · 3 comments

Comments

Projects
None yet
2 participants
@dudamoos
Copy link

dudamoos commented Feb 8, 2019

I have a fixture that I use for several of my tests that requires using the setup() and teardown() methods offered by the flexible fixture interface. I use BOOST_FIXTURE_TEST_CASE to declare my test cases so I can use members of this fixture class in my test code. This works fine when I use it for normal test cases, but when I try to use it for test cases with datasets (declared via BOOST_DATA_TEST_CASE_F), the setup() and teardown() methods don't get called, causing the test cases to crash. Looking at the code, I notice that the code to run test cases with datasets doesn't call setup_conditional() or teardown_conditional() like the normal fixture test case code does. That should be a trivial fix, and should help avoid surprises in the future.

@raffienficiaud

This comment has been minimized.

Copy link
Member

raffienficiaud commented Feb 8, 2019

Yes, I am aware of this one :) thanks for the reminder!

@raffienficiaud

This comment has been minimized.

Copy link
Member

raffienficiaud commented Feb 10, 2019

In branch topic/GH-203-dataset-new-fixtures if you want to give a try.

@raffienficiaud raffienficiaud self-assigned this Feb 10, 2019

@raffienficiaud raffienficiaud added this to the 1.70 milestone Feb 10, 2019

raffienficiaud added a commit that referenced this issue Feb 11, 2019

Merge branch 'topic/GH-203-dataset-new-fixtures' into next-internal
* topic/GH-203-dataset-new-fixtures:
  Change log
  Extended fixture messages for template test cases
  Dataset test case: allowing fixtures w. setup/teardown

# Conflicts:
#	doc/closing_chapters/change_log.qbk

@raffienficiaud raffienficiaud added next and removed fix-proposed labels Feb 12, 2019

@dudamoos

This comment has been minimized.

Copy link
Author

dudamoos commented Feb 13, 2019

That fix does the trick. I'll work on getting everyone here using an upgraded or patched version. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.