From 6be79b6f3f097abcdf1a1ec6d1a3878240f52b93 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 3 Jun 2026 12:08:16 +0200 Subject: [PATCH] Make `--list` always list all tests, even filtered ones. --- .gitignore | 1 + src/ParallelTestRunner.jl | 8 ++++++++ test/runtests.jl | 14 ++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/.gitignore b/.gitignore index 6e24bde..9408c22 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ Manifest.toml /docs/build/ +*.cov diff --git a/src/ParallelTestRunner.jl b/src/ParallelTestRunner.jl index 4b040f4..141c746 100644 --- a/src/ParallelTestRunner.jl +++ b/src/ParallelTestRunner.jl @@ -761,8 +761,16 @@ end Filter tests in `testsuite` based on command-line arguments in `args`. Returns `true` if additional filtering may be done by the caller, `false` otherwise. + +When `--list` is requested, the full `testsuite` is preserved and `false` is +returned so that callers skip any conditional filtering of their own: listing +should show every available test, not just the ones that would run by default. """ function filter_tests!(testsuite, args::ParsedArgs) + # when only listing tests, keep the full catalog and let the caller skip its + # own filtering, so that every available test is shown + args.list !== nothing && return false + # the user did not request specific tests, so let the caller do its own filtering isempty(args.positionals) && return true diff --git a/test/runtests.jl b/test/runtests.jl index 7b4ce92..1a65c66 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -713,6 +713,20 @@ end @test filter_tests!(testsuite, args) == false @test isempty(testsuite) end + + @testset "listing preserves all tests" begin + testsuite = Dict("a" => :(), "b" => :(), "c" => :()) + args = parse_args(["--list"]) + @test filter_tests!(testsuite, args) == false + @test length(testsuite) == 3 + end + + @testset "listing ignores positional filters" begin + testsuite = Dict("a" => :(), "b" => :()) + args = parse_args(["--list", "a"]) + @test filter_tests!(testsuite, args) == false + @test length(testsuite) == 2 + end end @testset "find_tests edge cases" begin