Add ignore for python in general and project specific tmp files
[deliverable/lttng-ivc.git] / lttng_b_test / utils / ProjectFactory.py
CommitLineData
bcc7759d
JR
1import os
2import logging
3import yaml
4
5import lttng_b_test.utils.project as Project
6
7
8_logger = logging.getLogger('project.factory')
9_conf_file = os.path.dirname(os.path.abspath(__file__)) + "/../run_configuration.yaml"
10_project_constructor = {
11 'babeltrace': Project.Babeltrace,
12 'lttng-modules': Project.Lttng_modules,
13 'lttng-tools': Project.Lttng_tools,
14 'lttng-ust': Project.Lttng_ust,
15}
16
17_markers = None
18with open(_conf_file, 'r') as stream:
19 # This is voluntary static across call, no need to perform this
20 # every time.
21 _markers = yaml.load(stream)
22
23
24def get(label, tmpdir):
25 if label not in _markers:
26 # TODO: specialized exception, handle it caller-side so the caller
27 # can decide to skip or fail test.
28 raise Exception('Label is no present')
29 marker = _markers[label]
30 constructor = _project_constructor[marker['project']]
31 path = marker['path']
32 sha1 = marker['sha1']
33 return constructor(label, path, sha1, tmpdir)
This page took 0.024289 seconds and 5 git commands to generate.