Skip to content

Commit 169a8e4

Browse files
authored
Rename testfilter and update docs. (#30)
1 parent 9db5194 commit 169a8e4

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

src/ParallelTestRunner.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,13 @@ function recycle_worker(p)
358358
end
359359

360360
"""
361-
runtests(mod::Module, ARGS; testfilter = Returns(true), RecordType = TestRecord, custom_tests = Dict())
361+
runtests(mod::Module, ARGS; RecordType = TestRecord,
362+
test_filter = Returns(true),
363+
custom_tests = Dict(),
364+
init_code = :(),
365+
test_worker = Returns(nothing),
366+
stdout = Base.stdout,
367+
stderr = Base.stderr)
362368
363369
Run Julia tests in parallel across multiple worker processes.
364370
@@ -370,13 +376,14 @@ Run Julia tests in parallel across multiple worker processes.
370376
371377
Several keyword arguments are also supported:
372378
373-
- `testfilter`: Optional function to filter which tests to run (default: run all tests)
374379
- `RecordType`: Type of test record to use for tracking test results (default: `TestRecord`)
380+
- `test_filter`: Optional function to filter which tests to run (default: run all tests)
375381
- `custom_tests`: Optional dictionary of custom tests, mapping test names to expressions.
376382
- `init_code`: Code use to initialize each test's sandbox module (e.g., import auxiliary
377383
packages, define constants, etc).
378384
- `test_worker`: Optional function that takes a test name and returns a specific worker.
379385
When returning `nothing`, the test will be assigned to any available default worker.
386+
- `stdout` and `stderr`: I/O streams to write to (default: `Base.stdout` and `Base.stderr`)
380387
381388
## Command Line Options
382389
@@ -386,7 +393,6 @@ Several keyword arguments are also supported:
386393
- `--quickfail`: Stop the entire test run as soon as any test fails
387394
- `--jobs=N`: Use N worker processes (default: based on CPU threads and available memory)
388395
- `TESTS...`: Filter tests by name, matched using `startswith`
389-
- `stdout` and `stderr`: I/O streams to write to (default: `Base.stdout` and `Base.stderr`)
390396
391397
## Behavior
392398
@@ -408,7 +414,7 @@ runtests(MyModule, ARGS)
408414
runtests(MyModule, ["integration"])
409415
410416
# Run with custom filter function
411-
runtests(MyModule, ARGS; testfilter = test -> occursin("unit", test))
417+
runtests(MyModule, ARGS; test_filter = test -> occursin("unit", test))
412418
413419
# Use custom test record type
414420
runtests(MyModule, ARGS; RecordType = MyCustomTestRecord)
@@ -419,7 +425,7 @@ runtests(MyModule, ARGS; RecordType = MyCustomTestRecord)
419425
Workers are automatically recycled when they exceed memory limits to prevent out-of-memory
420426
issues during long test runs. The memory limit is set based on system architecture.
421427
"""
422-
function runtests(mod::Module, ARGS; testfilter = Returns(true), RecordType = TestRecord,
428+
function runtests(mod::Module, ARGS; test_filter = Returns(true), RecordType = TestRecord,
423429
custom_tests::Dict{String, Expr}=Dict{String, Expr}(), init_code = :(),
424430
test_worker = Returns(nothing), stdout = Base.stdout, stderr = Base.stderr)
425431
#
@@ -512,7 +518,7 @@ function runtests(mod::Module, ARGS; testfilter = Returns(true), RecordType = Te
512518

513519
# filter tests
514520
if isempty(ARGS)
515-
filter!(testfilter, tests)
521+
filter!(test_filter, tests)
516522
else
517523
# let the user filter
518524
filter!(tests) do test

0 commit comments

Comments
 (0)