summaryrefslogtreecommitdiffstats
path: root/scripts/run_tests.sh
diff options
context:
space:
mode:
authorLibravatarUnit 193 <unit193@ubuntu.com>2019-07-02 04:33:45 -0400
committerLibravatarUnit 193 <unit193@ubuntu.com>2019-07-02 04:33:45 -0400
commit195c45911e79c33cf0bb986721365fb06df5a153 (patch)
treeac0c9b6ef40bea7aa7ab0c5c3cb500eb510668fa /scripts/run_tests.sh
Import Upstream version 1.8.7upstream/1.8.7
Diffstat (limited to 'scripts/run_tests.sh')
-rwxr-xr-xscripts/run_tests.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh
new file mode 100755
index 0000000..334671e
--- /dev/null
+++ b/scripts/run_tests.sh
@@ -0,0 +1,24 @@
+#!/bin/bash
+
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+
+TESTS_CORE=(config cookies downloader extractor oauth text util)
+TESTS_RESULTS=(results)
+
+
+# select tests
+case "${1:-${GALLERYDL_TESTS:-core}}" in
+ core) TESTS=( ${TESTS_CORE[@]} );;
+ results) TESTS=( ${TESTS_RESULTS[@]} );;
+ *) TESTS=( );;
+esac
+
+
+# transform each array element to test_###.py
+TESTS=( ${TESTS[@]/#/test_} )
+TESTS=( ${TESTS[@]/%/.py} )
+
+
+# run 'nosetests' with selected tests
+# (or all tests if ${TESTS} is empty)
+nosetests --verbose -w "${DIR}/../test" ${TESTS[@]}