phobos
phobos copied to clipboard
Only incorporate VariantN doc tests in doc builds.
The tests are for documentation and are located inside a template. This means they'll run every time you instantiate the VariantN template.
The unfortunate effect of this commit is that the documentation tests will not be executed, allowing them to get out of date. The obvious way to deal with this is to require every documentation test to run and to add -version=StdDdoc when compiling for the test target.
Thanks for your pull request and interest in making D better, @dhasenan! We are looking forward to reviewing it, and you should be hearing from a maintainer soon. Please verify that your PR follows this checklist:
- My PR is fully covered with tests (you can see the annotated coverage diff directly on GitHub with CodeCov's browser extension
- My PR is as minimal as possible (smaller, focused PRs are easier to review than big ones)
- I have provided a detailed rationale explaining my changes
- New or modified functions have Ddoc comments (with
Params:andReturns:)
Please see CONTRIBUTING.md for more information.
If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment.
Bugzilla references
| Auto-close | Bugzilla | Severity | Description |
|---|---|---|---|
| ✓ | 18818 | regression | VariantN has unittests that are compiled into user modules |
⚠️⚠️⚠️ Warnings ⚠️⚠️⚠️
- Regression or critical bug fixes should always target the
stablebranch. Learn more about rebasing tostableor the D release process.
To target stable perform these two steps:
- Rebase your branch to
upstream/stable:
git rebase --onto upstream/stable upstream/master
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 + phobos#6491"
StdDdoc isn't set when the test are run on the auto-tester which essentially means they are disabled, so a copy of these tests probably needs to be moved outside to ensure that no regressions occur...
The problem with merely copying those tests out is that the documentation versions are not executed and can become outdated. Should we have another version flag for documentation tests, one that's enabled for both documentation and unittest builds?
An alternative would be to pick a type list that's unique and static if the tests.
An example from stdx.checkedint:
static if (is(T == int) && is(Hook == void)) @system unittest