pcvs.backend.utilities module

class pcvs.backend.utilities.AutotoolsBuildSystem(root, dirs=None, files=None)[source]

Bases: BuildSystem

Derived BuildSystem targeting Autotools projects.

fill()[source]

Populate the dict relatively to the build system to build the proper YAML representation.

class pcvs.backend.utilities.BuildSystem(root, dirs=None, files=None)[source]

Bases: object

Manage a generic build system discovery service.

Variables
  • _root – the root directory the discovery service is attached to.

  • _dirs – list of directory found in _root.

  • _files – list of files found in _root

  • _stream – the resulted dict, representing targeted YAML architecture

fill()[source]

This function should be overriden by overriden classes.

Nothing to do, by default.

generate_file(filename='pcvs.yml', force=False)[source]

Build the YAML test file, based on path introspection and build model.

Parameters
  • filename (str) – test file suffix

  • force (bool) – erase target file if exist.

class pcvs.backend.utilities.CMakeBuildSystem(root, dirs=None, files=None)[source]

Bases: BuildSystem

Derived BuildSystem targeting CMake projects.

fill()[source]

Populate the dict relatively to the build system to build the proper YAML representation.

class pcvs.backend.utilities.MakefileBuildSystem(root, dirs=None, files=None)[source]

Bases: BuildSystem

Derived BuildSystem targeting Makefile-based projects.

fill()[source]

Populate the dict relatively to the build system to build the proper YAML representation.

pcvs.backend.utilities.compute_scriptpath_from_testname(testname, output=None)[source]

Locate the proper ‘list_of_tests.sh’ according to a fully-qualified test name.

Parameters
  • testname (str) – test name belonging to the script

  • output (str, optional) – prefix to walk through, defaults to current directory

Returns

the associated path with testname

Return type

str

pcvs.backend.utilities.get_logged_output(prefix, testname)[source]
pcvs.backend.utilities.locate_scriptpaths(output=None)[source]

Path lookup to find all ‘list_of_tests’ script within a given prefix.

Parameters

output (str, optional) – prefix to walk through, defaults to current directory

Returns

the list of scripts found in prefix

Return type

List[str]

pcvs.backend.utilities.process_check_configs()[source]

Analyse available configurations to ensure their correctness relatively to their respective schemes.

Returns

caught errors, as a dict, where the keys is the errmsg base64

Return type

dict

pcvs.backend.utilities.process_check_directory(dir, pf_name='default')[source]

Analyze a directory to ensure defined test files are valid.

Parameters

dir (str) – the directory to process.

Returns

a dict of caught errors

Return type

dict

pcvs.backend.utilities.process_check_profiles()[source]

Analyse availables profiles and check their correctness relatively to the base scheme.

Returns

list of caught errors as a dict, where keys are error msg base64

Return type

dict

pcvs.backend.utilities.process_check_setup_file(filename, prefix, run_configuration)[source]

Check if a given pcvs.setup could be parsed if used in a regular process.

Parameters
  • filename (str) – the pcvs.setup filepath

  • prefix (str) – the subtree the setup is extract from (used as argument)

Returns

a tuple (err msg, icon to print, parsed data)

Return type

tuple

pcvs.backend.utilities.process_check_yaml_stream(data)[source]

Analyze a pcvs.yml stream and check its correctness relatively to standard. :param data: the stream to process :type data: str :return: a tuple (err_msg, load status icon, yaml format status icon) :rtype: tuple

pcvs.backend.utilities.process_discover_directory(path, override=False, force=False)[source]

Path discovery to detect & intialize build systems found.

Parameters
  • path (str) – the root path to start with

  • override (bool) – True if test files should be generated, default to False

  • force (bool) – True if test files should be replaced if exist, defaut to False