~lttng/babeltrace/trunk

  • Committer: Simon Marchi
  • Date: 2023-05-31 19:47:48 UTC
  • Revision ID: git-v1:484a30244f4297ce7f0ac0ea1c0c4d566b39c46e
tests: add framework to run code in comp cls / comp / msg iter context

Add a little framework to make it easier to write tests that need a
bt_self_component_class, bt_self_component or bt_self_message_iterator.
This is inspired from what we have already in
tests/lib/conds/utils.{hpp,cpp}, but decoupled from the
pre/post-condition assertion tests.  A subsequent commit will change
this test to use the new framework.

The framework exposes the run_in function, which accepts three callbacks
that are executed at three different points in the graph's lifecycle,
providing access to all three contexts.  Each callback may be nullptr.

For convenience, there are also three functions to run code in each
individual context:

 - runInCompClsQuery
 - runInCompClsInitFunc
 - runInMsgIterClsInitFunc

If needed, some additional hook points can be added later, to access
other points of the graph's lifecycle.

The run_in function makes an end-to-end run:

 - creates a graph
 - creates a source component class
 - makes a query on that component class
 - adds a source component
 - adds a dummy sink component, connects the ports of the two components
 - runs the graph

Even for a test that only needs to run code in component class context,
for instance, we still run the whole enchilada.  This is a bit
inefficient, but given that this is just for testing, we don't really
care, as it still runs quick.

Change-Id: Ie532b316dc330758b60fd5f6fe9499f0555f8a8a
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/10060
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins <jenkins@lttng.org>
Filename Latest Rev Last Changed Committer Comment Size
..
doc 376 12 years ago Mathieu Desnoyers Add babeltrace.1 manpage Signed-off-by: Mathieu D Diff
include 1 13 years ago Mathieu Desnoyers Common Trace Format - initial commit Signed-off-b Diff
LICENSES 4126 4 years ago Philippe Proulx Move to kernel style SPDX license identifiers The Diff
m4 545 11 years ago Mathieu Desnoyers Babeltrace python binding The Babeltrace Python m Diff
src 3138 5 years ago Philippe Proulx Re-organize sources * Create a top-level 'src' d Diff
tests 1 13 years ago Mathieu Desnoyers Common Trace Format - initial commit Signed-off-b Diff
tools 4236 2 years ago Philippe Proulx Add `tools/format-cpp` script The new `format-cpp Diff
version 4074 4 years ago Philippe Proulx common: support custom, extra information for buil Diff
.clang-format 4270 2 years ago Philippe Proulx .clang-format: update for clang-format 13 This pa 3.3 KB Diff Download File
.editorconfig 4377 1 year ago Philippe Proulx Add .editorconfig entry for .h and .c files Chang 260 bytes Diff Download File
.gitignore 4312 2 years ago Simon Marchi .gitignore: generated files moved to cpp Change-I 1.4 KB Diff Download File
.gitreview 2989 5 years ago Francis Deslauriers Add git-review config Signed-off-by: Michael Jean 123 bytes Diff Download File
File bootstrap 4224 3 years ago Jérémie Galarneau Fix: bootstrap with autoconf >= 2.70 We want to e 491 bytes Diff Download File
ChangeLog 4079 4 years ago Jérémie Galarneau Release: Babeltrace 2.0.0 "Amqui" Released at lon 4.9 KB Diff Download File
CodingStyle 3392 4 years ago Philippe Proulx Explicitly mention `black` in CodingStyle guidelin 469 bytes Diff Download File
configure.ac 4393 1 year ago Simon Marchi tests: add framework to run code in comp cls / com 33.8 KB Diff Download File
CONTRIBUTING.adoc 4375 1 year ago Philippe Proulx Change required clang-format version to 15 No cha 55.9 KB Diff Download File
dev-requirements.txt 4314 2 years ago Simon Marchi Use Black stable to format python code The first 28 bytes Diff Download File
LICENSE 4126 4 years ago Philippe Proulx Move to kernel style SPDX license identifiers The 1.8 KB Diff Download File
Makefile.am 4282 2 years ago Philippe Proulx Add `std::optional` replacement (`nonstd::optional 446 bytes Diff Download File
pyproject.toml 4332 1 year ago Simon Marchi Remove `skip-string-normalization` in Python forma 314 bytes Diff Download File
README.adoc 4373 1 year ago Philippe Proulx fix: document proper Bison version requirement Th 9.1 KB Diff Download File
setup.cfg 3756 4 years ago Simon Marchi Add setup.cfg with sensible flake8 configuration 341 bytes Diff Download File
std-ext-lib.txt 1 13 years ago Mathieu Desnoyers Common Trace Format - initial commit Signed-off-b 1.9 KB Diff Download File