Private API
This page lists non-exported (internal) symbols of TestRunner.
From TestRunner
_glob_to_regex
TestRunner._glob_to_regex — Function
_glob_to_regex(pattern::AbstractString) -> RegexConvert a glob pattern (using * and ?) into a regular expression.
The returned regex is anchored (matches the full string).
_parse_test_args
TestRunner._parse_test_args — Function
_parse_test_args(args::Vector{String}) -> Tuple{Vector{Symbol}, Bool, Bool}Parse command-line test arguments, filtering out coverage-related flags.
Returns (selections, run_all, dry_run) where:
selections: selection patterns provided by the user (as symbols)run_all: whether-a/--allwas presentdry_run: whether-n/--dryrunwas present
_run_single_test
TestRunner._run_single_test — Function
_run_single_test(name::Symbol; kwargs...)Run a single selected test.
This helper:
- Resolves a test filename via
filename_builder - Includes the file into
Main - Optionally evaluates a function (via
funcname_builder) wheneval_mode=true
This function is not part of the public API.
_select_tests
TestRunner._select_tests — Function
Determine which tests to run based on selections, available_tests filter, and file globbing.
- Identify potential test files in
test_dir(default:test/). - Filter by
available_testsif provided. - Filter by
selections(interpreted as globs) if present.
Notes
If available_tests is empty, this function falls back to an auto-discovery heuristic using the filename stem as the candidate test name.
CTBase.run_tests
CTBase.run_tests — Method
run_tests(::CTBase.TestRunnerTag; kwargs...)Run tests with configurable file/function name builders and optional available tests filter.
Keyword Arguments
testset_name::String = "Tests"— name of the main testsetavailable_tests::Vector{Symbol} = Symbol[]— if non-empty, only these tests are allowedfilename_builder::Function = identity—Symbol → Symbol, builds the filename from the test namefuncname_builder::Function = identity—Symbol → Symbol|Nothing, builds the function name (or nothing to skip eval)eval_mode::Bool = true— whether to eval the function after includeverbose::Bool = true— verbose testset outputshowtiming::Bool = true— show timing in testset output
Notes
- Test selection is driven by
Main.ARGS(coverage flags are ignored). - Selection arguments are interpreted as glob patterns and matched against both the test name and the corresponding filename.
Usage sketch (non-executed)
using CTBase
# CTBase.run_tests(; testset_name="Tests")