pcvs.testing.tedesc module

class pcvs.testing.tedesc.TEDescriptor(name, node, label, subprefix)[source]

Bases: object

A Test Descriptor (named TD, TE or TED), maps a test prograzm representation, as defined by a root node in a single test files.

A TE Descriptor is not a test but a definition of a program (how to use it, to compile it…), leading to a collection once combined with a profile (providing on which MPI processes to run it, for instance).

Variables:
  • _te_name – YAML root node name, part of its unique id

  • _te_label – which user directory this TE is coming from

  • _te_subtree – subprefix, relative to label, where this TE is located

  • _full_name – fully-qualified te-name

  • _srcdir – absolute path pointing to the YAML testfile dirname

  • _buildir – absolute path pointing to build equivalent of _srcdir

  • _skipped – flag if this TE should be unfolded to tests or not

  • _effective_cnt – number of tests created by this single TE

  • _program_criterion – extra criterion defined by the TE

  • others – used yaml node references.

construct_tests()[source]

Construct a collection of tests (build & run) from a given TE.

This function will process a YAML node and, through a generator, will create each test coming from it.

get_attr(name, dflt=None)[source]
get_debug()[source]

Build information debug for the current TE.

Returns:

the debug info

Return type:

dict

classmethod init_system_wide(base_criterion_name)[source]

Initialize system-wide information (to shorten accesses).

Parameters:

base_criterion_name (str) – iterator name used as scheduling resource.

property name

Getter to the current TE name.

Returns:

te_name

Return type:

str

pcvs.testing.tedesc.build_job_deps(deps_node, pkg_label, pkg_prefix)[source]

Build the dependency list from a given depenency YAML node.

A depends_on is used by test to establish their relationship. It looks like:

Example:
depends_on:

[“list_of_test_name”]

Parameters:
  • deps_node (dict) – the TE/job YAML node.

  • pkg_label (str) – the label where this TE is from (to compute depnames)

  • pkg_prefix – the subtree where this TE is from (to compute depnames)

:type pkg_prefix, str or NoneType

Returns:

a list of dependencies, either as depnames or PManager objects

Return type:

list

pcvs.testing.tedesc.build_pm_deps(deps_node)[source]

Build the dependency list from a given YAML node.

This only initialize package-manager oriented deps. For job deps, see build_job_deps

Parameters:

deps_node (str) – contains package_manager YAML information

Returns:

a list of PM objects, one for each entry

Return type:

List[PManager]

pcvs.testing.tedesc.detect_source_lang(array_of_files)[source]

Determine compilation language for a target file (or list of files).

Only one language is detected at once.

Parameters:

array_of_files (list) – list of files to identify

Returns:

the language code

Return type:

str

pcvs.testing.tedesc.extract_compiler_config(lang, variants)[source]

Build resource to compile based on language and variants involved.

Parameters:
  • lang (str) – target language

  • variants (list) – list of enabled variants

Returns:

the program, its args and env modifiers (in that order)

Return type:

tuple