Add option to run tests by prefix

`bash test/extension/test.sh test_cdb_querytables`
will run all tests that start with test_cdb_querytables
This commit is contained in:
Raul Ochoa 2015-09-03 12:59:20 +02:00
parent 4fe85a6a76
commit 350c76f847

View File

@ -227,7 +227,12 @@ function run_tests() {
local TESTS local TESTS
if [[ $# -ge 1 ]] if [[ $# -ge 1 ]]
then then
TESTS="$@" if [[ $# -eq 1 ]]
then
TESTS=`cat $0 | grep -o "$1[^\(]*"`
else
TESTS="$@"
fi
else else
TESTS=`cat $0 | perl -n -e'/function (test.*)\(\)/ && print "$1\n"'` TESTS=`cat $0 | perl -n -e'/function (test.*)\(\)/ && print "$1\n"'`
fi fi