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

Rework the IWYU test to handle types with multiple valid sources #2633

Merged
merged 2 commits into from
Mar 25, 2019

Conversation

wilhuff
Copy link
Contributor

@wilhuff wilhuff commented Mar 25, 2019

This handles #include <iostream> in xcgmock.h.

The previous implementation failed because it required <iosfwd> to be included from headers, even though <iostream> or <ostream> is sufficient.

This essentially changes the algorithm to ensure that individual entities have their headers covered rather than compiling a list of required headers. The latter is no longer computable if we allow this flexibility.

'build/include_what_you_use', 4,
'Add #include ' + required_header_unstripped + ' for ' + template)
'Add #include ' + preferred_header + ' for ' + template)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very optional: ideally, I'd output the alternatives as well, not only the preferred_header. Feel free to ignore if it's annoying to implement.

Copy link
Contributor Author

@wilhuff wilhuff Mar 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now outputs:

Firestore/core/test/firebase/firestore/testutil/xcgmock.h:103:  Add #include <iosfwd> for ostream (or <ostream>, <iostream>)  [build/include_what_you_use] [4]

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@var-const var-const assigned wilhuff and unassigned var-const Mar 25, 2019
@wilhuff wilhuff merged commit 080c64d into master Mar 25, 2019
@wilhuff wilhuff deleted the wilhuff/iwyu branch March 25, 2019 23:38
@firebase firebase locked and limited conversation to collaborators Oct 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants