From: Simon Marchi Date: Mon, 3 Jun 2019 20:48:45 +0000 (-0400) Subject: bt2: Adapt test_message_iterator.py and make it pass X-Git-Url: http://git.efficios.com/?a=commitdiff_plain;h=c5f330cd909f5dfbdb519546e875b4427434ba4f;hp=c5f330cd909f5dfbdb519546e875b4427434ba4f;p=babeltrace.git 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 Signed-off-by: Francis Deslauriers Reviewed-on: https://review.lttng.org/c/babeltrace/+/1326 Tested-by: jenkins Reviewed-by: Philippe Proulx ---