junit-interface icon indicating copy to clipboard operation
junit-interface copied to clipboard

Better detection of illegal options

Open szeiger opened this issue 11 years ago • 1 comments

Currently any non-option parameter is treated as a glob pattern which can lead to surprising bugs. For example, see https://gist.github.com/ktoso/baba2cacad58bddd4235 which is caused by "testOptions in Test += Tests.Argument("-oDF")" (parameters for ScalaTest which are not scoped correctly). Since glob patterns starting with a dash should be rare, I suggest we require an extra "--" separator before any such options, e.g. "test-only -- -v -a -- -reallyAPattern". Any other argument starting with a dash before this separator should be reported as an error and fail the whole test run.

szeiger avatar Oct 08 '14 13:10 szeiger

Yes, that would be a great change, the above sample gist really confused me for quite a while! And for unknown options simply blow up, explaining "if you really wanted to ... use --".

Related issue in case someone thinks his problem is "junit-interface can't see java tests" etc: https://github.com/akka/akka/pull/16053

ktoso avatar Oct 08 '14 13:10 ktoso