2018-03-19 17:57:32 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-01-31 15:55:45 +01:00
|
|
|
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
|
|
|
|
2018-03-25 15:10:25 +02:00
|
|
|
TESTS_CORE=(config cookies downloader extractor oauth text util)
|
2018-03-19 18:07:19 +01:00
|
|
|
TESTS_RESULTS=(results)
|
2018-03-19 17:57:32 +01:00
|
|
|
|
|
|
|
|
|
|
|
# select tests
|
2019-01-31 15:55:45 +01:00
|
|
|
case "${1:-${GALLERYDL_TESTS:-core}}" in
|
2018-03-19 17:57:32 +01:00
|
|
|
core) TESTS=( ${TESTS_CORE[@]} );;
|
|
|
|
results) TESTS=( ${TESTS_RESULTS[@]} );;
|
2019-01-31 15:55:45 +01:00
|
|
|
*) TESTS=( );;
|
2018-03-19 17:57:32 +01:00
|
|
|
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)
|
2019-01-31 15:55:45 +01:00
|
|
|
nosetests --verbose -w "${DIR}/../test" ${TESTS[@]}
|