bt2: Adapt test_message_iterator.py and make it pass
Update test_message_iterator.py to work with the current Babeltrace API.
Most changes are related to the fact that it is not possible anymore to
create most objects in isolation, everything is derived from a trace
class. Message iterators are created in the _graph_is_configured
callback rather than _port_connected. Because of this, we now need to
call graph.run() in the tests to get _graph_is_configured called.
I noticed that the component method of _SelfPortInputMessageIterator was
a bit problematic, as we don't know the type of the component at that
point. Returning the right type of component (the right Python class,
wrapping the right type of Swig pointer) would require a bit of dirty
work. I am not sure this is even useful, so I've just removed it and
marked the tests as skipped / commented them out (they can be removed if
we rule this is indeed unnecessary).
An important change is the addition the self_output_port parameter in
the constructor of _UserMessageIterator (which the user is expected to
override). This parameter is how the iterator is supposed to know what
it's supposed to iterate on (if the component has multiple ports).
There are no other changes in message_iterator.py, since everything had
to be done already for test_message.py to pass.
Change-Id: I574d812ed81d9628a8e4a2a2dd5c593c4d730c95
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1326
Tested-by: jenkins
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
This page took 0.025188 seconds and 4 git commands to generate.