From: David Steele Date: Mon, 9 Jun 2014 16:08:18 +0000 (+0100) Subject: Updated test scripts to allow executing smaller numbers of tests X-Git-Tag: dali_1.0.0~65 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=commitdiff_plain;h=67ae153437d442c741f99046d5694b5ad88e01d8 Updated test scripts to allow executing smaller numbers of tests [problem] Executing test cases takes too long [cause] Granularity is too high [solution] Add option to run tests from a specific test case file Change-Id: I1023fd50f65d903c16e36965370f3777293a1271 Signed-off-by: David Steele --- diff --git a/automated-tests/execute.sh b/automated-tests/execute.sh index ec5c9e2..3b5bd62 100755 --- a/automated-tests/execute.sh +++ b/automated-tests/execute.sh @@ -2,7 +2,7 @@ function execute { - scripts/tctestsgen.sh $1 `pwd` desktop + scripts/tctestsgen.sh $1 `pwd` desktop $2 testkit-lite -f `pwd`/tests.xml -o tct-${1}-core-tests.xml -A --comm localhost scripts/add_style.pl $1 } @@ -12,14 +12,14 @@ rm -f tct*core-tests.xml if [ -n "$1" ] ; then echo EXECUTING ONLY $1 - execute $1 + execute $* else for mod in `ls -1 src/ | grep -v CMakeList ` do if [ $mod != 'common' ] && [ $mod != 'manual' ]; then echo EXECUTING $mod - execute $mod + execute $mod $* fi done fi 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) diff --git a/automated-tests/scripts/tctestsgen.sh b/automated-tests/scripts/tctestsgen.sh index 4b920b9..1881668 100755 --- a/automated-tests/scripts/tctestsgen.sh +++ b/automated-tests/scripts/tctestsgen.sh @@ -60,7 +60,7 @@ print "" }' $TFILE > $FILE } -(cd $SCRIPT_DIR/..; scripts/retriever.sh -f src/$MODULE_NAME > ${TFILE}_pre) +(cd $SCRIPT_DIR/..; scripts/retriever.sh -f src/$MODULE_NAME $4 > ${TFILE}_pre) if [ $? -ne 0 ]; then cat ${TFILE}_pre; exit 1; fi cat ${TFILE}_pre | sort -t',' -k2,2 -s > $TFILE gen