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)
committerFrancis Deslauriers <francis.deslauriers@efficios.com>
Thu, 2 May 2019 20:50:15 +0000 (20:50 +0000)
commit601c002660cfc2434293a50a1bec418a6b41fdaf
tree043e13c4c10bd39cdfc65760d3a4879027b8e4d9
parent752d0e479c6f7b1d4a5abcfa4ddf8dc0734d2e10
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.02505 seconds and 4 git commands to generate.