Add Python plugin provider tests
This is a simple test for Python plugins. I'm using Python to load
the Python plugin for simplicity, but the C API could load it as well.
This tests both python-plugin-provider/python-plugin-provider.c and
bindings/python/bt2/py_plugin.py.
What happens is this:
1. test.sh executes Python which executes the test
(test_python_plugin_provider.py).
2. test_python_plugin_provider.py imports the bt2 Python package.
3. The bt2 Python package imports _native_bt.so.
4. _native_bt.so is linked with libbabeltrace.so.
5. libbabeltrace.so, on construction, loads
libbabeltrace-python-plugin-provider.so.
5. test_python_plugin_provider.py tries to load the Python plugin
with `bt2.find_plugins()`.
6. `bt2.find_plugins()` calls plugin_create_all_from_file(), which,
since the path points to a Python file, makes the Python plugin
provider try to initialize the Python interpreter (already
initialized by Python in step 1), import the `bt2.py_plugin` module,
and load the Python file to create a bt_plugin object.
Then the test makes sure that the returned Python plugin object has the
expected properties and component classes.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
This page took 0.029815 seconds and 4 git commands to generate.