-
Notifications
You must be signed in to change notification settings - Fork 285
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: ExportableFixture for JSON tests exporting #821
Conversation
ec6f96f
to
fbc09a8
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #821 +/- ##
=======================================
Coverage 97.98% 97.98%
=======================================
Files 113 114 +1
Lines 11155 11158 +3
=======================================
+ Hits 10930 10933 +3
Misses 225 225
Flags with carried forward coverage won't be shown. Click here to find out more.
|
class ExportableFixture : public testing::Test | ||
{ | ||
protected: | ||
std::unique_ptr<std::ostream> export_out; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't work, it has to be std::unique_ptr<std::ofstream>
otherwise proper file stream destructor is not called and file is not written to disk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What a hell? Am I doing something wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not sure why it doesn't work. But this is fixed differently now because we also want to avoid creating empty files. So the file creation is left up to the concrete test suite.
I also added a cmake test that verifies an example file was created during export.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still not sure why it doesn't work
I'm also not sure anymore, becaue apparently destructor is indeed virtual 🤷♂️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was able to reproduce the same issue.
fbc09a8
to
27f0910
Compare
Extract utils for JSON tests exporting to abstract `ExportableFixture`.
To follow the ExportableFixture file naming convention.
27f0910
to
5de76a6
Compare
Extract utils for JSON tests exporting to abstract
ExportableFixture
.