Skip to content

Commit a13c7e0

Browse files
committed
Simplify.
1 parent f59b6c2 commit a13c7e0

File tree

1 file changed

+4
-34
lines changed

1 file changed

+4
-34
lines changed

src/ParallelTestRunner.jl

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -445,41 +445,14 @@ function addworker(; env=Vector{Pair{String, String}}())
445445
end
446446

447447
"""
448-
find_tests([f], dir::String) -> Dict{String, Expr}
448+
find_tests(dir::String) -> Dict{String, Expr}
449449
450450
Discover test files in a directory and return a test suite dictionary.
451451
452452
Walks through `dir` and finds all `.jl` files (excluding `runtests.jl`), returning a
453-
dictionary mapping test names to expressions that run those tests.
454-
455-
## Arguments
456-
457-
- `f`: Optional function that takes a file path and returns an expression to execute
458-
(default: `path -> :(include(\$path))`)
459-
- `dir`: Directory to search for test files
460-
461-
## Returns
462-
463-
A `Dict{String, Expr}` where keys are test names (file paths relative to `dir` with
464-
`.jl` extension removed and path separators normalized to `/`) and values are expressions
465-
to execute for each test.
466-
467-
## Examples
468-
469-
```julia
470-
# Auto-discover tests with default include behavior
471-
testsuite = find_tests(pwd())
472-
473-
# Custom expression for each test file
474-
testsuite = find_tests(pwd()) do path
475-
quote
476-
@info "Running test: \$path"
477-
include(\$path)
478-
end
479-
end
480-
```
453+
dictionary mapping test names to expression that include each test file.
481454
"""
482-
function find_tests(f, dir::String)
455+
function find_tests(dir::String)
483456
tests = Dict{String, Expr}()
484457
for (rootpath, dirs, files) in walkdir(dir)
485458
# find Julia files
@@ -508,14 +481,11 @@ function find_tests(f, dir::String)
508481

509482
for file in files
510483
path = joinpath(rootpath, file * ".jl")
511-
tests[file] = f(path)
484+
tests[file] = :(include($path))
512485
end
513486
end
514487
return tests
515488
end
516-
find_tests(dir::String) = find_tests(dir) do path
517-
:(include($path))
518-
end
519489

520490
"""
521491
runtests(mod::Module, ARGS; testsuite::Dict{String,Expr}=find_tests(pwd()),

0 commit comments

Comments
 (0)