258
only some tests should be run or that some tests should be
259
excluded from a run.
260
261
-The argument for --run is a list of individual test numbers or
262
-ranges with an optional negation prefix that define what tests in
263
-a test suite to include in the run. A range is two numbers
264
-separated with a dash and matches a range of tests with both ends
265
-been included. You may omit the first or the second number to
266
-mean "from the first test" or "up to the very last test"
267
-respectively.
268
-
269
-Optional prefix of '!' means that the test or a range of tests
270
-should be excluded from the run.
261
+The argument for --run, <test-selector>, is a list of description
262
+substrings or globs or individual test numbers or ranges with an
263
+optional negation prefix (of '!') that define what tests in a test
264
+suite to include (or exclude, if negated) in the run. A range is two
265
+numbers separated with a dash and matches a range of tests with both
266
+ends been included. You may omit the first or the second number to
267
+mean "from the first test" or "up to the very last test" respectively.
268
+
269
+The argument to --run is split on commas into separate strings,
270
+numbers, and ranges, and picks all tests that match any of the
271
+individual selection criteria. If the substring of the description
272
+text that you want to match includes a comma, use the glob character
273
+'?' instead. For example --run='rebase,merge?cherry-pick' would match
274
+on all tests that match either the glob *rebase* or the glob
275
+*merge?cherry-pick*.
276
277
If --run starts with an unprefixed number or range the initial
278
set of tests to run is empty. If the first item starts with '!'
280
determined every test number or range is added or excluded from
281
the set one by one, from left to right.
282
278
-Individual numbers or ranges could be separated either by a space
279
-or a comma.
280
-
283
For example, to run only tests up to a specific test (21), one
284
could do this:
285
292
Common case is to run several setup tests (1, 2, 3) and then a
293
specific test (21) that relies on that setup:
294
293
- $ sh ./t9200-git-cvsexport-commit.sh --run='1 2 3 21'
295
+ $ sh ./t9200-git-cvsexport-commit.sh --run='1,2,3,21'
296
297
or:
298
300
301
or:
302
301
- $ sh ./t9200-git-cvsexport-commit.sh --run='-3 21'
303
+ $ sh ./t9200-git-cvsexport-commit.sh --run='-3,21'
304
305
As noted above, the test set is built by going through the items
306
from left to right, so this:
307
306
- $ sh ./t9200-git-cvsexport-commit.sh --run='1-4 !3'
308
+ $ sh ./t9200-git-cvsexport-commit.sh --run='1-4,!3'
309
310
will run tests 1, 2, and 4. Items that come later have higher
311
precedence. It means that this:
312
311
- $ sh ./t9200-git-cvsexport-commit.sh --run='!3 1-4'
313
+ $ sh ./t9200-git-cvsexport-commit.sh --run='!3,1-4'
314
315
would just run tests from 1 to 4, including 3.
316
319
320
$ sh ./t9200-git-cvsexport-commit.sh --run='!7-11'
321
322
+Sometimes there may be multiple tests with e.g. "setup" in their name
323
+that are needed and rather than figuring out the number for all of them
324
+we can just use "setup" as a substring/glob to match against the test
325
+description:
326
+
327
+ $ sh ./t0050-filesystem.sh --run=setup,9-11
328
+
329
+or one could select both the setup tests and the rename ones (assuming all
330
+relevant tests had those words in their descriptions):
331
+
332
+ $ sh ./t0050-filesystem.sh --run=setup,rename
333
+
334
Some tests in a test suite rely on the previous tests performing
335
certain actions, specifically some tests are designated as
336
"setup" test, so you cannot _arbitrarily_ disable one test and