Fix execute.sh to support test about part of module
authorJiwon Kim <jiwon177.kim@samsung.com>
Tue, 7 Feb 2017 07:31:04 +0000 (16:31 +0900)
committerJiwon Kim <jiwon177.kim@samsung.com>
Tue, 7 Feb 2017 07:51:26 +0000 (16:51 +0900)
Currently if someone hope to run test-suite for specific modules,
he has to edit tet_scen manually.

This commit support parameter to choice test module.
And support legacy behavior too.

Usage e.g) ./execute.sh mobile ECORE EDJE

Change-Id: Icb13bcb4e5c9a7b850a477be0a42b37387b97190
Signed-off-by: Jiwon Kim <jiwon177.kim@samsung.com>
TC/execute.sh

index fd5a5d8cfc40702b00151b1222d4c5a0b90cda83..dfd90d5258b78012d06b66a1d11fb53292bd14bc 100755 (executable)
@@ -18,7 +18,7 @@
 function usage_echo()
 {
        echo "Usage:"
-       echo "           ./execute [PROFILE]"
+       echo "           ./execute.sh [PROFILE]"
        echo ""
        echo "Choice of the profile below :"
        echo "(example : ./execute mobile)"
@@ -26,6 +26,16 @@ function usage_echo()
        echo "mobile                     Mobile Profile"
        echo "wear                              Wearable Profile"
        echo "tv                                  TV Profile"
+       echo ""
+       echo "Usage 2:"
+       echo "           ./execute.sh [PROFILE] [Module1] [Module2] ..."
+       echo ""
+       echo "Choice specific modules which you want to run test :"
+       echo ""
+       echo "ECORE EDJE   EET        EINA"
+       echo "EIO   ELDBUS ELEMENTARY EVAS"
+       echo ""
+       echo "e.g) ./execute.sh mobile ECORE EDJE"
 }
 
 env | grep "XDG_RUNTIME_DIR" >/dev/null
@@ -119,9 +129,24 @@ while read line; do
                then
                        continue;
                else
-                       temp_line=$line
-                       echo ${temp_line:1};
-                       echo ${temp_line:1} >> $FileLibsScen
+                       if [ "$2" == "" ]
+                       then
+                               temp_line=$line
+                               echo ${temp_line:1};
+                               echo ${temp_line:1} >> $FileLibsScen
+                       else # If second param exist
+                               # Add only specific modules to execution list file ($FileLibsScen)
+                               for params in "${@:2}"
+                               do
+                                       if [ "^$params-$1" == $line ]
+                                       then
+                                               temp_line=$line
+                                               echo ${temp_line:1};
+                                               echo ${temp_line:1} >> $FileLibsScen
+                                               continue;
+                                       fi
+                               done
+                       fi
                fi
        fi
 done < $filename