ctest#
- warn_unsupported_ctest_option(option: str) None#
- class CTestTestGenerator(root: str, path: str | None = None)#
Bases:
AbstractTestGenerator- file_patterns: ClassVar[tuple[str, ...]] = ('CTestTestfile.cmake',)#
- lock(on_options: list[str] | None = None) list[ResolvedSpec]#
Expand parameters and instantiate concrete test cases
- Parameters:
on_options – User specified options used to filter tests. Test cases not matching
on_optionsshould be masked.
Notes
For further discussion on filtering tests see Filtering tests.
- describe(on_options: list[str] | None = None) str#
Return a description of the test
- info() dict[str, Any]#
- load() dict#
Load and transform the tests loaded from CMake into a form understood by nvtest
testsis of the form{NAME: {'command': [...], 'properties': [{'name': ..., 'value': ...}, ...]}, ...}and is transformed in place to the form:
{NAME: {'command': [...], 'prop_name': prop_value, ...}, ...}
- resolve_fixtures(specs: list[ResolvedSpec]) None#
- resolve_inter_dependencies(drafts: list[UnresolvedSpec]) list[ResolvedSpec]#
- create_draft_spec(*, file_root: str, file_path: str, family: str, command: list[str], ctestfile: str, attached_files: list[str] | None = None, attached_files_on_fail: list[str] | None = None, cost: float | None = None, depends: list[str] | None = None, disabled: bool = False, environment: dict[str, str] | None = None, environment_modification: list[dict[str, str]] | None = None, fail_regular_expression: list[str] | None = None, fixtures_cleanup: list[str] | None = None, fixtures_required: list[str] | None = None, fixtures_setup: list[str] | None = None, generated_resource_spec_file: str | None = None, labels: list[str] | None = None, measurement: dict[str, float | str] | None = None, pass_regular_expression: list[str] | None = None, processor_affinity: bool = False, processors: int | None = None, required_files: list[str] | None = None, resource_groups: list[list[dict[str, Any]]] | None = None, resource_lock: list[str] | None = None, run_serial: bool = False, skip_regular_expression: list[str] | None = None, skip_return_code: int | None = None, timeout: float | None = None, timeout_after_match: dict[str, str | float] | None = None, timeout_signal_grace_period: float | None = None, timeout_signal_name: str | None = None, will_fail: bool | None = None, working_directory: str | None = None, backtrace_triples: list[str] | None = None, **kwds) UnresolvedSpec#
- env_mods(mods: list[dict[str, str]]) list[dict[str, str]]#
- resource_groups_vars(case: TestCase) dict[str, str]#
Set the resource group variables as required by CTest
canary does not have a notion of resource groups, like ctest does. When a test checks out resources from a pool the resources are in a dictionary of the form
{str: list[spec]}
where a spec is:
{“slots”: N, “count”: N}
- safeint(arg: str) None | int#
- parse_np(args: list[str]) int | None#
- load(file: str) dict[str, Any]#
Use ctest –show-only
- find_project_binary_dir(start: str) str | None#
- infer_project_source_dir(project_binary_dir: str) str | None#
- find_cmake()#
- parse_resource_groups(resource_groups: list[dict[str, list]]) list[list[dict[str, Any]]]#
- parse_environment(environment: list[str]) dict[str, str]#
Convert the CTest ENVIRONMENT list[str] to dict[str, str]:
[“name=value”, …, “name=value”] -> {“name”: “value”, …}
- parse_environment_modification(environment_modification: list[str]) list[dict[str, str]]#
Convert the CTest ENVIRONMENT_MODIFICATION list[str] to list[dict]:
[“name=op:value”, …, “name=op:value”] -> [{“name”: “name”, “op”: “op”, “value”: “value”, …}]
- read_resource_specs(file: str) dict#
- validate_resource_specs(resource_specs: dict) dict#