#! /usr/bin/env bash # # run-example wrapper script. # Script location SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" # Load global paths source "${SCRIPT_DIR}/../../infrastructure/paths.sh" # Activate the python venv activate_venv # A specified qualifier should be used to set the env for finding uxas qualifier=$( get_option "$*" "--qualifier" ) if [[ -n ${qualifier} ]]; then debug_and_run "eval \"\$( \"${OPENUXAS_ROOT}/anod\" printenv uxas \"${qualifier}\" )\"" debug_and_run "python3 \"${TESTS_DIR}/cpp/run-tests.py\" ${@/$qualifier}" # Assume the user would prefer to use the locally built uxas elif [ -f "${UXAS_BIN}" ]; then debug_and_run "PATH=\"${OBJ_DIR}/cpp:$PATH\" python3 \"${TESTS_DIR}/cpp/run-tests.py\" $*" # Try to find uxas for the user else debug_and_run "eval \"\$( \"${OPENUXAS_ROOT}/anod\" printenv uxas )\"" debug_and_run "python3 \"${TESTS_DIR}/cpp/run-tests.py\" $*" fi