update .travis.yml
- restrict builds to master branch and release tags - implement 'core' and 'results' test categories
This commit is contained in:
24
scripts/run_tests.sh
Executable file
24
scripts/run_tests.sh
Executable 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[@]}
|
||||
Reference in New Issue
Block a user