Private API

This page lists non-exported (internal) symbols of TestRunner.


From TestRunner

_glob_to_regex

TestRunner._glob_to_regexFunction
_glob_to_regex(pattern::AbstractString) -> Regex

Convert a glob pattern (using * and ?) into a regular expression.

The returned regex is anchored (matches the full string).

_parse_test_args

TestRunner._parse_test_argsFunction
_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 / --all was present
  • dry_run: whether -n / --dryrun was present

_run_single_test

TestRunner._run_single_testFunction
_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) when eval_mode=true

This function is not part of the public API.

_select_tests

TestRunner._select_testsFunction

Determine which tests to run based on selections, available_tests filter, and file globbing.

  1. Identify potential test files in test_dir (default: test/).
  2. Filter by available_tests if provided.
  3. 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_testsMethod
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 testset
  • available_tests::Vector{Symbol} = Symbol[] — if non-empty, only these tests are allowed
  • filename_builder::Function = identitySymbol → Symbol, builds the filename from the test name
  • funcname_builder::Function = identitySymbol → Symbol|Nothing, builds the function name (or nothing to skip eval)
  • eval_mode::Bool = true — whether to eval the function after include
  • verbose::Bool = true — verbose testset output
  • showtiming::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")