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.
- 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
:type pkg_prefix, str or NoneType
- Returns
a list of dependencies, either as depnames or PManager objects
- Return type
- 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.
- pcvs.testing.tedesc.prepare_cmd_build_variants(variants=[])[source]
Build the list of extra args to add to a test using variants.
Each defined variant comes with an
arg
option. When tests enable this variant, these definitions are additioned to test compilation command. For instance, the variantomp
defines -fopenmp within GCC-based profile. When a test requests to be built weomp
variant, the flag is appended to cflags.