tests: use -z / -n to test for string empty / non-empty
[babeltrace.git] / tests / utils / run_python_bt2
index c016624fb99d6579273eada54d6b0b92b6ccebaf..574900a2c48c586484ec25c712b5cfd14d06b94c 100755 (executable)
@@ -1,22 +1,10 @@
 #!/bin/bash
 #
+# SPDX-License-Identifier: GPL-2.0-only
+#
 # Copyright (C) 2017 Philippe Proulx <pproulx@efficios.com>
 # Copyright (C) 2019 Simon Marchi <simon.marchi@efficios.com>
 #
-# 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
@@ -26,7 +14,7 @@
 #     -t test_value.MapValueTestCase.test_deepcopy \
 #     ./tests/bindings/python/bt2
 
-if [ "x${BT_TESTS_SRCDIR:-}" != "x" ]; then
+if [ -n "${BT_TESTS_SRCDIR:-}" ]; then
        UTILSSH="$BT_TESTS_SRCDIR/utils/utils.sh"
 else
        UTILSSH="$(dirname "$0")/../utils/utils.sh"
@@ -45,7 +33,7 @@ usage() {
        echo "the path to the built 'tests' directory."
 }
 
-if [ "x$*" = "x" ]; then
+if [ -z "$*" ]; then
        usage
        exit 1
 fi
This page took 0.025274 seconds and 4 git commands to generate.