tests: run_python_bt2: error out if BT_TESTS_BUILDDIR does not point to a build directory
authorSimon Marchi <simon.marchi@efficios.com>
Sat, 29 Jun 2019 14:06:58 +0000 (10:06 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 18 Jul 2019 05:27:04 +0000 (01:27 -0400)
commitb841eced73b140d37c264befa35279e8b357c0d3
treeb205516718cd19b75b6eba85e713082bd136ff8e
parent75948c32af7168b25c864db28e8c695bb797a0dd
tests: run_python_bt2: error out if BT_TESTS_BUILDDIR does not point to a build directory

This patch improves the user experience when building out of tree, using
run_python_bt2, but forgetting to set BT_TESTS_BUILDDIR.

Currently, the script doesn't complain when you do this, but sets
variables (e.g. PYTHONPATH) to point to files/directories that don't
exist:

  $ /home/simark/src/babeltrace/tests/utils/run_python_bt2 python3
  >>> import bt2
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  ModuleNotFoundError: No module named 'bt2'

With this patch, the user gets notified that they did something wrong:

  /home/simark/src/babeltrace/tests/utils/run_python_bt2: BT_TESTS_BUILDDIR does
  not point to a valid directory
  (/home/simark/src/babeltrace/tests/utils/../utils/../Makefile does not exist).

  If building out-of-tree, set BT_TESTS_BUILDDIR to point to the tests directory
  in the build tree.

Change-Id: Ibbc6e11b6cbfce560ad97081d709ed4794c406b1
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1583
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
tests/utils/run_python_bt2
This page took 0.025841 seconds and 4 git commands to generate.