1
0
mirror of https://github.com/mikf/gallery-dl.git synced 2024-11-22 18:53:21 +01:00
gallery-dl/scripts/run_tests.sh

25 lines
611 B
Bash
Raw Normal View History

#!/bin/bash
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)
# 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[@]}