From 90a258daf1a31061d9b8f0fa3b692ee69181b19a Mon Sep 17 00:00:00 2001 From: Qingping Hou Date: Mon, 15 Feb 2016 22:34:48 -0800 Subject: [PATCH] kodev: add --tags option to test command --- kodev | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/kodev b/kodev index 6af4e59db..bbc8ffc19 100755 --- a/kodev +++ b/kodev @@ -246,10 +246,33 @@ OPTIONS: function kodev-test { TEST_HELP_MSG=" -usage: test [front|base] +usage: test [front|base] 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] 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 }