bt2: Adapt test_event.py and make it pass
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 13 May 2019 17:43:38 +0000 (13:43 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 13 Jun 2019 21:24:21 +0000 (17:24 -0400)
commit27d97a3f0002289edadd0b9c4a4f9d4b1b667569
tree5efd123052c4ea4d19dd4aeff00133cef206a7e2
parentddcfe1546e120c8250c327c7beb62eceeebc8e29
bt2: Adapt test_event.py and make it pass

This patch changes test_event.py to work with the current BT API and
adapts event.py accordingly to make it pass.  Since this is a central
piece of the API (it has many related concepts), a few other files are
modified as well, just enough to support the test.  For example, events
are no longer created directly, instead we need to instantiate an
EventMessage.  This requires to get the foundation for messages
working.  Even though the changes in message_iterator (the "create"
methods to create various messages) are not complete, it gives an idea
of what is to come, so it would be good to get some comments on it right
now.

In event.py, things related to clock snapshots, header fields, equality,
copy and deep copy are removed.

In test_event.py, we now need a bigger setup, since events are created
from event messages, which are created from output iterators, which are
created from components.

In object.py, UniqueObject now needs to record its _owner_get_ref
callback, so that if we get a second UniqueObject from an existing
UniqueObject (such as a sub-field from a struct field), the callback can
be passed to the new object.

Change-Id: I72309826a61245b0fe4fdd9a638ddee3689c5921
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/+/1298
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
Tested-by: jenkins
13 files changed:
bindings/python/bt2/bt2/__init__.py.in
bindings/python/bt2/bt2/clock_snapshot.py
bindings/python/bt2/bt2/component.py
bindings/python/bt2/bt2/event.py
bindings/python/bt2/bt2/field.py
bindings/python/bt2/bt2/field_class.py
bindings/python/bt2/bt2/graph.py
bindings/python/bt2/bt2/message.py
bindings/python/bt2/bt2/message_iterator.py
bindings/python/bt2/bt2/object.py
bindings/python/bt2/bt2/packet.py
bindings/python/bt2/bt2/trace_class.py
tests/bindings/python/bt2/test_event.py
This page took 0.02603 seconds and 4 git commands to generate.