Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ParallelTestRunner"
uuid = "d3525ed8-44d0-4b2c-a655-542cee43accc"
authors = ["Valentin Churavy <[email protected]>"]
version = "1.0.3"
version = "2.0.0"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
36 changes: 29 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,41 @@ using ParallelTestRunner
runtests(MyModule, ARGS)
```

### Filtering
### Customizing the test suite

`runtests` takes a keyword argument that acts as a filter function
By default, `runtests` automatically discovers all `.jl` files in your `test/` directory (excluding `runtests.jl` itself) using the `find_tests` function. You can customize which tests to run by providing a custom `testsuite` dictionary:

```julia
function test_filter(test)
if Sys.iswindows() && test == "ext/specialfunctions"
return false
# Manually define your test suite
testsuite = Dict(
"basic" => quote
include("basic.jl")
end,
"advanced" => quote
include("advanced.jl")
end
)

runtests(MyModule, ARGS; testsuite)
```

You can also use `find_tests` to automatically discover tests and then filter or modify them. This requires manually parsing arguments so that filtering is only applied when the user did not request specific tests to run:

```julia
# Start with autodiscovered tests
testsuite = find_tests(pwd())

# Parse arguments
args = parse_args(ARGS)

if filter_tests!(testsuite, args)
# Remove tests that shouldn't run on Windows
if Sys.iswindows()
delete!(testsuite, "ext/specialfunctions")
end
return true
end

runtests(MyModule, ARGS; test_filter)
runtests(MyModule, args; testsuite)
```

### Provide defaults
Expand Down
Loading