2019-05-15 14:53:55 +03:00
|
|
|
#!/bin/bash
|
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
|
|
|
# Licensed under the Apache 2.0 License.
|
|
|
|
|
2019-07-16 21:44:05 +03:00
|
|
|
set -e
|
|
|
|
|
2020-10-06 18:44:53 +03:00
|
|
|
echo "Setting up Python environment..."
|
2019-05-15 14:53:55 +03:00
|
|
|
if [ ! -f "env/bin/activate" ]
|
|
|
|
then
|
2020-09-11 18:33:09 +03:00
|
|
|
python3.8 -m venv env
|
2019-05-15 14:53:55 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
source env/bin/activate
|
2021-09-02 17:35:27 +03:00
|
|
|
pip install -U -q pip
|
|
|
|
pip install -q -U -e ../python/
|
|
|
|
pip install -q -U -r ../tests/requirements.txt
|
2020-10-06 18:44:53 +03:00
|
|
|
echo "Python environment successfully setup"
|
2019-05-15 14:53:55 +03:00
|
|
|
|
2023-02-27 11:50:22 +03:00
|
|
|
# We can delete it when
|
|
|
|
# lldb is included in the CI images
|
|
|
|
if ! command -v lldb; then
|
|
|
|
SUDO=""
|
|
|
|
if [ "$EUID" != 0 ]; then
|
|
|
|
SUDO="sudo"
|
|
|
|
fi
|
|
|
|
$SUDO apt update
|
|
|
|
$SUDO apt install -y lldb
|
|
|
|
fi
|
|
|
|
|
2020-10-28 21:46:35 +03:00
|
|
|
# Export where the VENV has been set, so tests running
|
|
|
|
# a sandbox.sh can inherit it rather create a new one
|
|
|
|
VENV_DIR=$(realpath env)
|
|
|
|
export VENV_DIR="$VENV_DIR"
|
|
|
|
|
2021-09-07 11:23:16 +03:00
|
|
|
# Enable https://github.com/Qix-/better-exceptions
|
|
|
|
export BETTER_EXCEPTIONS=1
|
|
|
|
|
2019-05-15 14:53:55 +03:00
|
|
|
ctest "$@"
|