Add bt_plugin test
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 19 Jan 2017 18:18:55 +0000 (13:18 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Sun, 28 May 2017 16:57:37 +0000 (12:57 -0400)
commitcbb9e0b1ec169269733bcd689294b1fd8be59a2c
treeef31923b2cc3d2652470e69a4aa5f106f8574105
parent33b34c437c354e1c065e33151135bc2e57e2e29c
Add bt_plugin test

This new test proves that the bt_plugin subsystem works as expected.

There are three Babeltrace plugins built in
`tests/lib/test-plugin-plugins`. They are:

* `minimal`: Minimal, valid plugin with no component classes.
* `sfs`: Valid plugin with a source, a filter, and a sink component
  class.
* `invalid`: Invalid plugin (missing name).

Verified in this test:

* Behaviour of bt_plugin_*() functions with non-existing paths, invalid
  arguments, etc.

* bt_plugin_create_from_file() can load a valid plugin and we can access
  all its properties.

* The initialization and exit functions of a plugin are called when
  expected.

* We can access the component classes of a plugin which provides some.

* We can still create a component from a component class provided by
  a plugin after the associated plugin object is destroyed, that is, the
  associated shared library handle is not closed until it is known that
  no more user code found in the loaded object will ever be executed
  again in the future.

* bt_plugin_create_all_from_dir() works as expected.

As of this patch, Valgrind shows for this test:

    ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
configure.ac
tests/lib/Makefile.am
tests/lib/test-plugin-plugins/Makefile.am [new file with mode: 0644]
tests/lib/test-plugin-plugins/invalid.c [new file with mode: 0644]
tests/lib/test-plugin-plugins/minimal.c [new file with mode: 0644]
tests/lib/test-plugin-plugins/sfs.c [new file with mode: 0644]
tests/lib/test_plugin.c [new file with mode: 0644]
tests/lib/test_plugin_complete.in [new file with mode: 0644]
This page took 0.025119 seconds and 4 git commands to generate.