X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=tests%2Futils%2Frun_python_bt2;h=fa5dd0cc4e5bca51a6302ece2e0c80907bbc9e59;hb=0b0893d4a069f17d1326ebc3bfc9f9f987f411f3;hp=7147da4ae0b675bbb4d9d4ab0a82cbc24858eb0f;hpb=5968a1ad29f571b0422e79c3ca28ba922fabe392;p=babeltrace.git diff --git a/tests/utils/run_python_bt2 b/tests/utils/run_python_bt2 index 7147da4a..fa5dd0cc 100755 --- a/tests/utils/run_python_bt2 +++ b/tests/utils/run_python_bt2 @@ -1,22 +1,10 @@ #!/bin/bash # +# SPDX-License-Identifier: GPL-2.0-only +# # Copyright (C) 2017 Philippe Proulx # Copyright (C) 2019 Simon Marchi # -# This program is free software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; only version 2 -# of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -# # Execute a shell command in the appropriate environment to have access to the # bt2 Python bindings. For example, one could use it to run a specific Python @@ -47,6 +35,17 @@ usage() { if [ "x$*" = "x" ]; then usage -else - run_python_bt2 "${@}" + exit 1 fi + +# Sanity check that the BT_TESTS_BUILDDIR value makes sense. +if [ ! -f "$BT_TESTS_BUILDDIR/Makefile" ]; then + fold -w 80 -s <<- END + $0: BT_TESTS_BUILDDIR does not point to a valid directory (\`$BT_TESTS_BUILDDIR/Makefile\` does not exist). + + If building out-of-tree, set BT_TESTS_BUILDDIR to point to the \`tests\` directory in the build tree. + END + exit 1 +fi + +run_python_bt2 "${@}"