bt2: update bindings to make test_component_class pass
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 1 May 2019 15:30:28 +0000 (11:30 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:40 +0000 (18:19 -0400)
commitbbb3650ffa25676b8425802ba1dd5614fc1db17f
tree3718d1356fe1a7cc93ea1c4da1fe2f7b5026ee20
parent61fd44ac72299fadcaa04c19c4ffee7bfa6ccadb
bt2: update bindings to make test_component_class pass

This patch updates the binding with the goal of making
test_component_class pass.

Besides the obviously needed changes to the component class code, there
are a bunch of changes to things around it (component, graph), just
enough to make the test run.

One notable change is the _SharedObject._release method, used to make the
Python object stop manage the reference it currently owns.

Another functional change is how the component classes _query method
reports that it's not implemented.  Currently, it default to return the
NotImplemented object.  Instead, I made it raise a NotImplementedError.
Returning NotImplemented is useful if the caller has an alternative to
try when the method is not implemented.  In our case, there is nothing
to do if the specific class doesn't implement _query.  The exception is
caught in bt_py3_component_class_query, where other types of exceptions
need to be handled anyway.

Some changes are required to the library, to be able to get a specific
component class type from a specific component (e.g. a
bt_component_class_source from a bt_component_source).

Change-Id: I895817bc996c21b6a9c6d57605cc64f9ff61dfcc
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1083
Tested-by: jenkins
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
bindings/python/bt2/bt2/component.py
bindings/python/bt2/bt2/graph.py
bindings/python/bt2/bt2/native_bt_query_exec.i
bindings/python/bt2/bt2/object.py
bindings/python/bt2/bt2/query_executor.py
tests/bindings/python/bt2/test_component_class.py
This page took 0.025395 seconds and 4 git commands to generate.