pcvs.testing.testfile module

class pcvs.testing.testfile.TestFile(file_in, path_out, data=None, label=None, prefix=None)[source]

Bases: object

A TestFile manipulates source files to be processed as benchmarks (pcvs.yml & pcvs.setup).

It handles global informations about source imports & building one execution script (list_of_tests.sh) per input file.

param _in

YAML input file

type _in

str

param _path_out

prefix where to store output artifacts

type _path_out

str

param _raw

stream to populate the TestFile rather than opening input file

type _raw

dict

param _label

label the test file comes from

type _label

str

param _prefix

subtree the test file has been extracted

type _prefix

str

param _tests

list of tests handled by this file

type _tests

list

param _debug

debug instructions (concatenation of TE debug infos)

type _debug

dict

cc_pm_string = ''
flush_sh_file()[source]

Store the given input file into their destination.

generate_debug_info()[source]

Dump debug info to the appropriate file for the input object.

load_from_str(data)[source]

Fill a File object from stream.

This allows reusability (by loading only once).

Parameters

data (YAMl-formatted str) – the YAML-formatted input stream.

process()[source]

Load the YAML file and map YAML nodes to Test().

rt_pm_string = ''
val_scheme = None
pcvs.testing.testfile.load_yaml_file(f, source, build, prefix)[source]

Load a YAML test description file.

Parameters
  • f (str) – YAML-based source testfile

  • source (str) – source directory (used to replace placeholders)

  • build (str) – build directory (placeholders)

  • prefix (str) – file subtree (placeholders)

Returns

the YAML-to-dict content

Return type

dict

pcvs.testing.testfile.replace_special_token(stream, src, build, prefix)[source]

Replace placeholders by their actual definition in a stream.

Parameters
  • stream (str) – the stream to alter

  • src (str) – source directory (replace SRCPATH)

  • build (str) – build directory (replace BUILDPATH)

  • prefix (str) – subtree for the current parsed stream

Returns

the modified stream

Return type

str