Skip to content

Commit

Permalink
scripts: Add a tests runner scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Siddharth Chandrasekaran <[email protected]>
  • Loading branch information
sidcha committed Jun 6, 2024
1 parent 9a620fe commit 120ad81
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions scripts/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

set -e

TEST_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
ROOT_DIR="${TEST_DIR}/../"

echo "[-] Running make check"
pushd ${ROOT_DIR}
rm -rf build
./configure.sh -f
make check
popd

echo "[-] Running cmake unit-tests"
rm -rf build && mkdir build && pushd build
cmake ${ROOT_DIR}
make check-ut
popd

echo "[-] Creating an isolated environment.."
pushd ${TEST_DIR}
rm -rf __pycache__/
rm -rf .venv ${ROOT_DIR}/python/{build,dist,libosdp.egg-info,vendor}
python3 -m venv .venv
source ./.venv/bin/activate
pip install --upgrade pip

echo "[-] Installing dependencies.."
pushd "${ROOT_DIR}/tests/pytest"
pip install -r requirements.txt

echo "[-] Installing libosdp.."
pip install "${ROOT_DIR}/python"

echo "[-] Running tests capturing all output.."
pytest -vv --show-capture=all
popd

0 comments on commit 120ad81

Please sign in to comment.