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

Parse unittest attributes and write them to the publictest tester #369

Merged
merged 1 commit into from
May 14, 2019

Conversation

wilzbach
Copy link
Member

While the underlying issue is https://issues.dlang.org/show_bug.cgi?id=19873, fixing this allows the Phobos PR to move on for now.

tl;dr: the publictest extractor now extracts the respective system attributes too.

Required for dlang/phobos#6931

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @wilzbach!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub fetch digger
dub run digger -- build "master + tools#369"

@wilzbach
Copy link
Member Author

(passing on TravisCI now - AppVeyor failure is unrelated.)

@wilzbach wilzbach merged commit 8bce501 into dlang:master May 14, 2019
@wilzbach wilzbach deleted the unittest-attributes branch May 14, 2019 21:15
if (!predefinedAttributes.canFind(atText))
continue;

outFile.write(text("@", atText, " "));
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this would work with attributes whose syntax doesn't start with @ , like pure and nothrow

Copy link
Member Author

Choose a reason for hiding this comment

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

Yup, but DScanner treats these guys differently:

$ dscanner --ast foo.d | xmllint --format -
<?xml version="1.0"?>
<module>
  <declaration>
    <attribute attribute="pure"/>
    <attribute>
      <atAttribute>
        <identifier>safe</identifier>
      </atAttribute>
    </attribute>
    <unittest>
      <blockStatement>
</blockStatement>
    </unittest>
  </declaration>
</module>

Copy link
Member Author

Choose a reason for hiding this comment

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

But yeah it's probably a good idea to extract these guys too while we're at it: #371

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

Successfully merging this pull request may close these issues.

4 participants