#!/bin/bash # # SPDX-FileCopyrightText: 2021-2022 EfficiOS, Inc. # SPDX-License-Identifier: GPL-2.0-only # Sets the variable named `$1` to `$2` if it's not set (or empty), and # exports it. _set_var_def() { local -r varname=$1 local -r val=$2 if [[ -z $(eval echo "\$$varname") ]]; then eval "$varname='$val'" fi export "${varname?}" } # Base source directory of tests, if not set _set_var_def BT_TESTS_SRCDIR '@abs_top_srcdir@/tests' # Base build directory of tests, if not set _set_var_def BT_TESTS_BUILDDIR '@abs_top_builddir@/tests' # Name of the `awk` command to use when testing, if not set _set_var_def BT_TESTS_AWK_BIN '@AWK@' # Name of the `grep` command to use when testing, if not set _set_var_def BT_TESTS_GREP_BIN '@GREP@' # Name of the `python3` command to use when testing, if not set _set_var_def BT_TESTS_PYTHON_BIN '@PYTHON@' # Name of the `python3-config` command to use when testing, if not set _set_var_def BT_TESTS_PYTHON_CONFIG_BIN '@PYTHON_CONFIG@' # Name of the `sed` command to use when testing, if not set _set_var_def BT_TESTS_SED_BIN '@SED@' # Name of the `cc` command to use when testing, if not set _set_var_def BT_TESTS_CC_BIN '@CC@' # `1` if AddressSanitizer is used, if not set _set_var_def BT_TESTS_ENABLE_ASAN '@ENABLE_ASAN@' # `1` to run tests which depend on Python plugin support, if not set _set_var_def BT_TESTS_ENABLE_PYTHON_PLUGINS '@ENABLE_PYTHON_PLUGINS@' # No more unset -f _set_var_def