kodev: add --tags option to test command

pull/1820/head
Qingping Hou 8 years ago
parent 6a6469fa09
commit 90a258daf1

27
kodev

@ -246,10 +246,33 @@ OPTIONS:
function kodev-test {
TEST_HELP_MSG="
usage: test [front|base] <TEST_NAME>
usage: test <OPTIONS> [front|base] <TEST_NAME>
TEST_NAME is optional. If no TEST_NAME is given, all tests will be run.
OPTIONS:
--tags=TAGS only run tests with given tags
"
while [[ $1 == '--'* ]]; do
PARAM=`echo $1 | awk -F= '{print $1}'`
VALUE=`echo $1 | awk -F= '{print $2}'`
case $PARAM in
--tags)
opts="--tags=${VALUE}"
;;
-h | --help)
echo "${TEST_HELP_MSG}"
exit 0
;;
*)
echo "ERROR: unknown option \"$PARAM\""
echo "${TEST_HELP_MSG}"
exit 1
;;
esac
shift
done
if [ $# -lt 1 ]; then
echo "${TEST_HELP_MSG}"
@ -265,7 +288,7 @@ usage: test [front|base] <TEST_NAME>
if [ ! -z $2 ]; then
test_path="${test_path}/$2"
fi
busted -o verbose_print --exclude-tags=notest ${test_path}
busted ${opts} -o verbose_print --exclude-tags=notest ${test_path}
popd
}

Loading…
Cancel
Save