summaryrefslogtreecommitdiffstats
path: root/tests/test.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 12:38:06 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-27 12:38:06 +0000
commit695ad2c6d0b157d2969c9b946d9e3765113a61e7 (patch)
treeeaab7e7e2523ad710afe779d532156258e40d5cc /tests/test.sh
parentInitial commit. (diff)
downloadpowerline-upstream.tar.xz
powerline-upstream.zip
Adding upstream version 2.8.1.upstream/2.8.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test.sh')
-rwxr-xr-xtests/test.sh42
1 files changed, 42 insertions, 0 deletions
diff --git a/tests/test.sh b/tests/test.sh
new file mode 100755
index 0000000..a08806f
--- /dev/null
+++ b/tests/test.sh
@@ -0,0 +1,42 @@
+#!/bin/bash
+. tests/shlib/common.sh
+
+enter_suite root
+
+if test "$TRAVIS" = true ; then
+ export PATH="$HOME/opt/fish/bin:${PATH}"
+ export PATH="$PWD/tests/bot-ci/deps/rc:$PATH"
+
+ if test "$PYTHON_IMPLEMENTATION" = "CPython" ; then
+ export PATH="$HOME/opt/zsh-${PYTHON_MM}${USE_UCS2_PYTHON:+-ucs2}/bin:${PATH}"
+ fi
+
+ if test -n "$USE_UCS2_PYTHON" ; then
+ export LD_LIBRARY_PATH="$HOME/opt/cpython-ucs2-$UCS2_PYTHON_VARIANT/lib${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+ set +e
+ . virtualenvwrapper.sh
+ workon cpython-ucs2-$UCS2_PYTHON_VARIANT
+ set -e
+ else
+ LIBRARY_PATH="$(ldd "$(command -v python)" | grep libpython | sed 's/^.* => //;s/ .*$//')"
+ LIBRARY_DIR="$(dirname "${LIBRARY_PATH}")"
+ export LD_LIBRARY_PATH="$LIBRARY_DIR${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+ fi
+fi
+
+export PYTHON="${PYTHON:=python}"
+export PYTHONPATH="${PYTHONPATH}${PYTHONPATH:+:}`realpath .`"
+for script in "$ROOT"/tests/test_*/test.sh ; do
+ test_name="${script##*/run_}"
+ if ! sh $script ; then
+ fail "${test_name%_tests.sh}" F "Failed $script"
+ fi
+done
+
+if test -e "$FAILURES_FILE" ; then
+ echo "Fails and skips summary:"
+ cat "$FAILURES_FILE"
+ rm "$FAILURES_FILE"
+fi
+
+exit_suite