File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11Manifest.toml
22/docs /build /
3+ * .cov
Original file line number Diff line number Diff line change 761761Filter tests in `testsuite` based on command-line arguments in `args`.
762762
763763Returns `true` if additional filtering may be done by the caller, `false` otherwise.
764+
765+ When `--list` is requested, the full `testsuite` is preserved and `false` is
766+ returned so that callers skip any conditional filtering of their own: listing
767+ should show every available test, not just the ones that would run by default.
764768"""
765769function filter_tests! (testsuite, args:: ParsedArgs )
770+ # when only listing tests, keep the full catalog and let the caller skip its
771+ # own filtering, so that every available test is shown
772+ args. list != = nothing && return false
773+
766774 # the user did not request specific tests, so let the caller do its own filtering
767775 isempty (args. positionals) && return true
768776
Original file line number Diff line number Diff line change 713713 @test filter_tests! (testsuite, args) == false
714714 @test isempty (testsuite)
715715 end
716+
717+ @testset " listing preserves all tests" begin
718+ testsuite = Dict (" a" => :(), " b" => :(), " c" => :())
719+ args = parse_args ([" --list" ])
720+ @test filter_tests! (testsuite, args) == false
721+ @test length (testsuite) == 3
722+ end
723+
724+ @testset " listing ignores positional filters" begin
725+ testsuite = Dict (" a" => :(), " b" => :())
726+ args = parse_args ([" --list" , " a" ])
727+ @test filter_tests! (testsuite, args) == false
728+ @test length (testsuite) == 2
729+ end
716730end
717731
718732@testset " find_tests edge cases" begin
You can’t perform that action at this time.
0 commit comments