From c637d72958fca8c04ca99f5655d11f4b3f77cbf6 Mon Sep 17 00:00:00 2001 From: Francis Deslauriers Date: Wed, 3 Jul 2019 11:34:02 -0400 Subject: [PATCH] CONTRIBUTING.adoc: add how to run `bt2` tests This commit adds a tiny testing section containing an introduction and a few useful commands to run the `bt2` tests. Philippe will without a doubt rework this section upon the release of Babeltrace 2.0. So this commit simply adds commands useful to developers in the meantime. Signed-off-by: Francis Deslauriers Change-Id: If4be315ddcc09efe9224e42de62c5b01c73ead8f Reviewed-on: https://review.lttng.org/c/babeltrace/+/1602 Reviewed-by: Philippe Proulx Tested-by: jenkins --- CONTRIBUTING.adoc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/CONTRIBUTING.adoc b/CONTRIBUTING.adoc index 416c4bfe..62dd8a9d 100644 --- a/CONTRIBUTING.adoc +++ b/CONTRIBUTING.adoc @@ -1474,3 +1474,33 @@ which originate from the Python interpreter anyway). `LIBBABELTRACE2_NO_DLCLOSE=1` makes libbabeltrace2 not close the shared libraries (plugins) which it loads. You need this to see the appropriate backtrace when Valgrind shows errors. + +== Testing + +=== Python Bindings + +To run all the `bt2` Python package tests use: + +---- +$ BT_TESTS_BUILDDIR=/path/to/build/babeltrace/tests \ + ./tests/bindings/python/bt2/test_python_bt2 +---- + +To run all the tests in a test module (e.g. `test_event.py`) use: + +---- +$ BT_TESTS_BUILDDIR=/path/to/build/babeltrace/tests \ + ./tests/utils/run_python_bt2 python3 ./tests/utils/python/testrunner.py \ + -t test_event \ + ./tests/bindings/python/bt2/ +---- + +To run a specific test (e.g. `EventTestCase.test_clock_value`) in a test module +(e.g. `test_event.py`) use: + +---- +$ BT_TESTS_BUILDDIR=/path/to/build/babeltrace/tests \ + ./tests/utils/run_python_bt2 python3 ./tests/utils/python/testrunner.py \ + -t test_event.EventTestCase.test_clock_value \ + ./tests/bindings/python/bt2/ +---- -- 2.34.1