`--tests` does not override include filters

Documentation states that

When the command line option is used, the inclusion filters declared in the build script are ignored.

when --tests refers to a class/method outside of the include scope, the behaviour varies depending on which method is used to configure inclusion, but will never be as expected

  • test.include: test will never be found if it’s out of scope of this expression
  • test.filter.includeTestsMatching or test.filter.setIncludePatterns: test will run, but so will all other ones matching the include

Verified against gradle-3.3 and gradle-3.4.1