Add skiptcdirremove, url, prefix-dir options for installing in tv. 11/131711/3
authorjang <jiseob.jang@samsung.com>
Tue, 30 May 2017 12:18:14 +0000 (21:18 +0900)
committerjang <jiseob.jang@samsung.com>
Thu, 1 Jun 2017 10:57:44 +0000 (19:57 +0900)
Change-Id: I6328899950e5a3ae280e2a241eb8afcf7e2c0a5f
Signed-off-by: jang <jiseob.jang@samsung.com>
install.sh
script/get_clr_results.sh

index a50a5db..01579db 100755 (executable)
@@ -13,8 +13,15 @@ usage()
     echo "              The name should can be found under http://165.213.149.200/download/public_mirror/tizen/"
     echo "              like tizen-mobile_20170215.2."
     echo "              Default is a latest repository."
-    echo "--skiprpminstall - Do not install rpm files"
-    echo "--skiptcinstall  - Do not install TC archive"
+    echo "--url       - You can specify the specific url of packages archive"
+    echo "              like http://165.213.149.200/download/public_mirror/tizen/base/tizen-base_20170520.1/repos/arm/packages/"
+    echo "              Default is a latest repository."
+    echo "--prefix-dir  - You can specify the prefix directory for performing the unittest"
+    echo "                like /opt/usr/coreclr-tc"
+    echo "                Default is '/opt/usr/coreclr-tc'."
+    echo "--skiprpminstall  - Do not install rpm files"
+    echo "--skiptcinstall   - Do not install TC archive"
+    echo "--skiptcdirremove - Do not remove TC directory"
     exit 1
 }
 
@@ -27,9 +34,11 @@ check_valid_url()
     fi
 }
 
-opt="-d"
-devicetype=
+opt=""
+devicetype="mobile"
 version="latest"
+url=""
+clrdir=""
 skiprpminstall=0
 skiptcinstall=0
 
@@ -53,12 +62,21 @@ do
         --version=*)
             version=${i#*=}
             ;;
+        --url=*)
+            url=${i#*=}
+            ;;
+        --prefix-dir=*)
+            clrdir=${i#*=}
+            ;;
         --skiprpminstall)
             skiprpminstall=1
             ;;
         --skiptcinstall)
             skiptcinstall=1
             ;;
+        --skiptcdirremove)
+            skiptcdirremove=1
+            ;;
         *)
             usage
             exit 1
@@ -74,6 +92,12 @@ if [ $? != 0 ]; then
        exit 1
 fi
 
+if [[ ${devicetype} != "mobile" ]] && [[ ${devicetype} != "tv" ]]; then
+       usage
+       exit 1
+fi
+
+
 str=$( sdb ${opt} shell "uname -a" )
 if [[ $str == *"x86_64"* ]]; then
     target_type="emulator"
@@ -88,17 +112,24 @@ else
     exit 1
 fi
 
-clrdir="/opt/usr/coreclr-tc"
+if [[ $clrdir == "" ]]; then
+       clrdir="/opt/usr/coreclr-tc"
+fi
 tcdir="$clrdir/Windows_NT.${tcarch}.Release"
 
-sdb ${opt} shell rm -rf $clrdir
+if [ $skiptcdirremove == 0 ]; then
+    sdb ${opt} shell rm -rf $clrdir
+fi
 sdb ${opt} shell mkdir -p ${clrdir}
 
 if [ $skiprpminstall == 0 ]; then
     echo "Target arch : ${target}"
     echo "Check valid repository url"
-    repo_url="http://165.213.149.200/download/public_mirror/tizen/unified"
-    url=$repo_url"/"$version"/repos/"$target_type"/packages/"$target
+    if [[ $url == "" ]]; then
+        repo_url="http://165.213.149.200/download/public_mirror/tizen/unified"
+        url=$repo_url"/"$version"/repos/"$target_type"/packages/"
+    fi
+    url=$url"/"$target"/"
     check_valid_url $url
 
     echo -e " \n\n---- Donwload coreclr-test-*.rpm ----"
@@ -158,4 +189,5 @@ echo -e "(You can use run.sh file in your host machine.)"
 echo -e "\nHow to convert useful csv file : "
 echo -e "(In host machine, not target)"
 echo -e "coreclr$ cd script"
-echo -e "coreclr/script$ ./get_clr_results.sh"
+echo -e "coreclr/script$ ./get_clr_results.sh --prefix-dir=${clrdir}"
+
index 568fd61..3acbb28 100755 (executable)
@@ -2,13 +2,14 @@
 
 usage()
 {
-    echo "Usage: $0 [device-name] --postfix=###"
+    echo "Usage: $0 [device-name] --postfix=### --prefix-dir=###"
     echo "device-name - You can get the name by using 'sdb devices' command"
     exit 1
 }
 
-opt="-d"
+opt=""
 postfix=''
+clrdir=""
 
 for i in "$@"
 do
@@ -24,6 +25,9 @@ do
     --postfix=*)
         postfix="_"${i#*=}
         ;;
+    --prefix-dir=*)
+        clrdir=${i#*=}
+        ;;
     *)
         opt="-s ${i#*}"
         ;;
@@ -48,7 +52,9 @@ version=$(awk -F "=" '/Build/ {print $2}' ./info.ini)
 version=${version%?}
 rm -rf ./info.ini
 
-clrdir="/opt/usr/coreclr-tc"
+if [[ ${clrdir} == "" ]]; then
+    clrdir="/opt/usr/coreclr-tc"
+fi
 name="CoreCLR_UnitTest_Results_"$version$postfix
 
 sdb ${opt} pull $clrdir/Windows_NT.${tcarch}.Release/coreclrtests.xml $name.xml