X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fscripts%2Fretriever.sh;h=37cabf6489dcd432e0ae43379f7dc421c06bbda1;hp=d3b123b415e13e53bc20b60b8e97199cb45e9b05;hb=56d412791a44c2a79135d2293c13fddb135c9d54;hpb=fa6279fb2830427d5ab569ca14e6ade1557ef2fa diff --git a/automated-tests/scripts/retriever.sh b/automated-tests/scripts/retriever.sh index d3b123b..37cabf6 100755 --- a/automated-tests/scripts/retriever.sh +++ b/automated-tests/scripts/retriever.sh @@ -161,14 +161,13 @@ function tc_fullinfo { # usage note and exit: -# - argument begin with '-' but is not recognised or number of arguments is > 2, -# - argument doesn't begin with '-' and number of arguments is > 1 -if [[ ( "$1" == -* && ( ! "$1" =~ ^-(anum|mnum|f)$ || $# > 2 ) ) || ( "$1" != -* && $# > 1 ) ]]; then +# - argument begin with '-' but is not recognised or number of arguments is > 3, +# - argument doesn't begin with '-' and number of arguments is > 2 +if [[ ( "$1" == -* && ( ! "$1" =~ ^-(anum|mnum|f)$ || $# > 3 ) ) || ( "$1" != -* && $# > 2 ) ]]; then echo -e "$USAGE" exit 1 fi - # get directory from last argument (or assume current one) if [[ ! "$1" =~ ^-(anum|mnum|f)$ ]]; then DIR=${1:-.} @@ -176,14 +175,30 @@ else DIR=${2:-.} fi +# get filename from last argument +if [[ $# == 3 && -f $DIR/$3 ]] ; then + FILE=$3 +elif [[ $# == 2 && -f $DIR/$2 ]] ; then + FILE=$2 +fi + +#Debug needs to be output on stderr ( calling script redirects stdout to file ) +#echo "Dir: $DIR File: $FILE" >& 2 # populate $TC_FILES with files declared in CMakeLists.txt -get_tc_files $DIR -if [ $? != 0 ]; then - exit 1 +if [[ -z $FILE ]]; then + get_tc_files $DIR + if [ $? != 0 ]; then + exit 1 + fi + echo "Got all files" >& 2 +else + TC_FILES="$DIR/$FILE" + echo "TC_FILES: $TC_FILES" >& 2 fi + # run appropriate subcommand case "$1" in -anum)