phobos icon indicating copy to clipboard operation
phobos copied to clipboard

Only incorporate VariantN doc tests in doc builds.

Open dhasenan opened this issue 7 years ago • 4 comments
trafficstars

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.

dhasenan avatar May 02 '18 05:05 dhasenan

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: and Returns:)

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 ⚠️⚠️⚠️

To target stable perform these two steps:

  1. Rebase your branch to upstream/stable:
git rebase --onto upstream/stable upstream/master
  1. Change the base branch of your PR to stable

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"

dlang-bot avatar May 02 '18 05:05 dlang-bot

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...

wilzbach avatar May 02 '18 06:05 wilzbach

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?

dhasenan avatar May 03 '18 01:05 dhasenan

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

wilzbach avatar Jun 08 '18 10:06 wilzbach