-
-
Notifications
You must be signed in to change notification settings - Fork 593
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
Issue 10992 - Missing unittests when using getUnittests trait #2544
Conversation
{ | ||
for (size_t i = 0; i < symbols->dim; i++) | ||
{ | ||
Dsymbol *symbol = (*symbols)[i]; | ||
UnitTestDeclaration *unitTest = symbol->unittest ? symbol->unittest : symbol->isUnitTestDeclaration(); | ||
UnitTestDeclaration *unitTest = symbol->isUnitTestDeclaration(); |
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.
Only isUnitTestDeclaration()
is not enough. Sometimes it will return null
where symbol->unittest
won't. If I recall correctly that happens when an UDA is attached to a unit test. I'm pretty sure this is covered in the DMD unit tests.
Will fix up soon. |
What was failing before is that I forgot to rename @jacob-carlborg: The tester seems to be going towards green, is there a specific test where using |
Those with UDA's if I recall correctly. |
Well it's green now. :) |
{ | ||
Dsymbols *decl = attrDecl->include(NULL, NULL); | ||
collectUnitTests(decl, uniqueUnitTests, unitTests); | ||
} |
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.
Adding one more test for this change would be better. Eg.
version(none)
{}
else
{
unittest { }
unittest { }
unittest { }
}
void main()
{
static assert(__traits(getUnitTests, mixin(__MODULE__)).length == 3);
}
@AndrejMitrovic Could you please collect the field renaming ( |
Other than nitpicks, LGTM. |
Separated out logical commits and added another test. But please wait for green. |
P.S. for anyone else new to editing specific commits, I've found this SO answer useful: http://stackoverflow.com/a/1186549/279684 Apparently the |
Thanks for the quick response. |
Issue 10992 - Missing unittests when using getUnittests trait
http://d.puremagic.com/issues/show_bug.cgi?id=10992