Skip to content

tests_extractor: Ignore conditional declaration blocks#249

Closed
wilzbach wants to merge 1 commit intodlang:masterfrom
wilzbach:ignore_cond_block
Closed

tests_extractor: Ignore conditional declaration blocks#249
wilzbach wants to merge 1 commit intodlang:masterfrom
wilzbach:ignore_cond_block

Conversation

@wilzbach
Copy link
Contributor

@wilzbach wilzbach commented Jul 9, 2017

Currently the tests extractor looks at all public declarations. There is one instance Phobos (std.digest.hmac) where this leads to errors.

make  -f posix.mak std/digest/hmac.publictests

due to the module header example:

version(StdDdoc)
/// Computes an HMAC over data read from stdin.
@safe unittest
{
 ...
    stdin.byChunk(4096)
...

this blocks and waits for input on the non-existing input on stdin.

@wilzbach wilzbach added the Type.Bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense label Jul 9, 2017
@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.

@CyberShadow
Copy link
Member

this blocks and waits for input on the non-existing input on stdin.

Interesting. So the intent there is just to check if the code compiles, I guess.

Generally, in the case of an outlier, it often makes more sense to fix or remove the outlier rather than add a work-around to the tool for that single corner case. Perhaps the example should be converted to one that's both testable automatically and runnable from the website? E.g. by putting some data in a file, then using that file instead of stdin.

@CyberShadow
Copy link
Member

dlang-bot closed this in dlang/phobos#5582 4 minutes ago

What happened? I didn't see anything in the commit messages there that would close this one.

@wilzbach
Copy link
Contributor Author

wilzbach commented Jul 9, 2017

What happened?

No idea.

I didn't see anything in the commit messages there that would close this one.

Same here.

@aG0aep6G
Copy link
Contributor

aG0aep6G commented Jul 9, 2017

dlang-bot closed this in dlang/phobos#5582 4 minutes ago

What happened? I didn't see anything in the commit messages there that would close this one.

The summary comment contains: "Fix: #249".

@wilzbach
Copy link
Contributor Author

Interesting. So the intent there is just to check if the code compiles, I guess.

I'm pretty sure the code wasn't checked as it did not compile - std.digest.hmac isn't @safe.
Hence it currently doesn't compile: https://is.gd/1g1EDn

Generally, in the case of an outlier, it often makes more sense to fix or remove the outlier rather than add a work-around to the tool for that single corner case. Perhaps the example should be converted to one that's both testable automatically and runnable from the website? E.g. by putting some data in a file, then using that file instead of stdin.

Good idea -> dlang/phobos#5587

@wilzbach wilzbach closed this Jul 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type.Bug Things don't work as they were intended to, or the way they were intended to work doesn't make sense

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants