update .travis.yml

- restrict builds to master branch and release tags
- implement 'core' and 'results' test categories
This commit is contained in:
Mike Fährmann
2018-03-19 17:57:32 +01:00
parent 3905474805
commit 8ef790de12
3 changed files with 48 additions and 14 deletions

24
scripts/run_tests.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
ROOTDIR="$(realpath "$(dirname "$0")/..")/"
TESTS_CORE=(config cookies oauth text util)
TESTS_RESULTS=(extractors)
# select tests
TESTS=()
case "${GALLERYDL_TESTS}" in
core) TESTS=( ${TESTS_CORE[@]} );;
results) TESTS=( ${TESTS_RESULTS[@]} );;
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 "${ROOTDIR}/test/" ${TESTS[@]}