Expand description
Discovery helpers for gdtest.
Two layers:
resolveturns user-supplied paths (files, directories,res://…) into a flat list ofres://…paths, filtered by discovery patterns.list_tests_inparses one GDScript file with tree-sitter-gdscript and returns everyfunc test_*()name in source order.
Default patterns (MOB-169):
test/**/*.gd— any.gdfile inside atest/directory tree**/*.test.gd— co-located test files anywhere in the project
Users can override via gdtest.toml: patterns = ["test/**/*.gd", "**/*.test.gd"]
Target: discovering 500 tests across 50 files in <100 ms on a warm cache (MOB-76 success criterion).
Re-exports§
pub use gdunit4_migrate::is_gdunit4_test_file;pub use gdunit4_migrate::is_gdunit4_test_source;pub use gdunit4_migrate::migrate_gdunit4_file;pub use gdunit4_migrate::migrate_gdunit4_source;pub use gdunit4_migrate::GdUnit4MigrationAction;pub use gdunit4_migrate::GdUnit4MigrationIssue;pub use gdunit4_migrate::GdUnit4MigrationOutput;pub use gdunit4_migrate::GdUnit4MigrationStatus;pub use gut_migrate::is_gut_test_file;pub use gut_migrate::is_gut_test_source;pub use gut_migrate::migrate_gut_file;pub use gut_migrate::migrate_gut_source;pub use gut_migrate::GutMigrationAction;pub use gut_migrate::GutMigrationIssue;pub use gut_migrate::GutMigrationOutput;pub use gut_migrate::GutMigrationStatus;pub use rewrite::rewrite_file;pub use rewrite::rewrite_source;pub use rewrite::RewriteOutput;
Modules§
- coverage
- GDScript coverage instrumentation.
- deps
- GDScript dependency graph for test impact analysis (MOB-151).
- gdunit4_
migrate - gut_
migrate - mutate
- GDScript mutation testing operators (MOB-152).
- rewrite
- GDScript assert rewriter — tree-sitter preprocessing for pytest-style rich diffs.
Structs§
- Test
Entry - A discovered test function with its run classification.
Enums§
- Test
Kind - Classification of a discovered test function.
Constants§
- DEFAULT_
PATTERNS - Default discovery patterns used when no
patternskey is ingdtest.toml.
Functions§
- extract_
describe_ dir - If
pathcontains a component nameddescribe_<Name>, return that component name. Used to prefix test function names for directory-based sub-suites (MOB-169). - glob_
match - Match a relative path (forward-slash separated) against a simple glob pattern.
Supports
**(zero or more path segments) and*(any chars within one segment). - list_
test_ entries_ in - Return every
func test_*()andfunc bench_*()in the given GDScript file, in source order. - list_
test_ entries_ in_ source - list_
tests_ in - Convenience wrapper: returns the names of tests that would actually run
(excludes
bench_*). - res_
to_ abs - Translate a res:// path to its on-disk absolute form.
- resolve
- Normalise every input path into a list of
res://…test-file paths. - to_
res_ path - Translate an absolute on-disk path to the res:// form used by the
worker. Caller guarantees
fileis insideproject_abs.