Skip to content

Commit 0176866

Browse files
author
David Saff
committed
Add info on --filter option
1 parent 60d16e0 commit 0176866

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

doc/ReleaseNotes4.12.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,21 @@ Version 4.11 added `Assert.assertEquals()` for `float` parameters with a delta,
1717
In the usual case, where the array elements are in fact exactly equal, the potentially expensive reflection-based loop to compare them is avoided by using `Arrays.deepEquals()` first. The exact comparison is only executed when `deepEquals()` returns `false`.
1818

1919

20+
# Command-line options
21+
### [Pull request #647:](https://github.com/junit-team/junit/pull/647) Support command-line `--filter` param.
22+
23+
When running JUnit from the command line, a command-line parameter can be supplied using `--filter`, which supplies a filter that will restrict which tests and subtests from the rest of the command will be run. For example, this will run only the tests in ExampleTestSuite that are in categories Cat1 or Cat2:
24+
25+
```
26+
java org.junit.runner.JUnitCore \
27+
--filter=org.junit.experimental.categories.IncludeCategories=pkg.of.Cat1,pkg.of.Cat2 \
28+
com.example.ExampleTestSuite
29+
```
30+
31+
In general, the argument to `--filter` should be `ClassName=param`, where `ClassName` names an implementation of `FilterFactory`, whose `createFilter` method will be called with an instance of `FilterFactoryParams` that contains `"param"`, in order to return the filter to be applied.
32+
33+
FilterFactory
34+
2035
# Test Runners
2136

2237

0 commit comments

Comments
 (0)