DazedTL/tests/run_tests.sh
DazedAnon 4d1b01c870 refactor!: rebrand product from DazedMTLTool to DazedTL
- Rename desktop launcher, window titles, About, and User-Agents
- Point QSettings at DazedTL with one-time migration from legacy app key
- Update README, Guide, skills, and launcher/script copy

BREAKING CHANGE: QSettings and desktop id now use DazedTL (legacy keys migrated once)
2026-07-22 12:27:22 -05:00

30 lines
879 B
Bash
Executable file

#!/usr/bin/env bash
# Run DazedTL unit tests using the project venv (cwd = project root).
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
cd "$ROOT"
PYTHON=""
if [[ -x "$ROOT/.venv/bin/python" ]]; then
PYTHON="$ROOT/.venv/bin/python"
elif [[ -x "$ROOT/venv/bin/python" ]]; then
PYTHON="$ROOT/venv/bin/python"
else
echo "ERROR: No virtual environment found (.venv or venv)." >&2
echo "Create one first, e.g.: python3 -m venv .venv && .venv/bin/pip install -r requirements.txt" >&2
exit 1
fi
if ! "$PYTHON" -c "import colorama, dotenv, tqdm" >/dev/null 2>&1; then
echo "Installing test dependencies from requirements.txt..."
"$PYTHON" -m pip install -r requirements.txt
fi
if [[ "$#" -eq 0 ]]; then
set -- discover -s tests -p 'test_*.py' -v
fi
exec "$PYTHON" -m unittest "$@"