tests: run some Python tests with CTF 1 and CTF 2 traces
The goal of this patch is to run as many Python-based tests that use CTF
traces against both CTF 1 and CTF 2. I would like to minimize the
amount of changes and boilerplate necessary in each individual test.
I've taken the approach to add a decorator named `test_all_ctf_versions`
to the test classes, inspired by the parameterized Python package [1].
Unlike the decorators, from parameterized, our decorator is hardcoded
for what we need. When applied to a class, it makes two copies of all
`test_*` methods of that class, suffixed with `_ctf_1` and `_ctf_2`, and
removes the original method. The two new methods are in fact wrapped in
a small wrapper that sets the `_ctf_version` attribute on the class
(with the value 1 or 2) for the duration of the method call.
The changes necessary in the test themselves are to make the test trace
paths dependent on `self._ctf_version`, instead of hard-coded.
[1] https://pypi.org/project/parameterized/
Change-Id: Idef27183db6287630e63260395d255e68da2a4c3
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/8737
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/12755
This page took 0.024751 seconds and 4 git commands to generate.