[TCT][scripts_tpk][Non-ACR][Modification for 64 bit device and emulator / syncing...
authorAmritanshu Pandia <a.pandia1@samsung.com>
Fri, 11 Nov 2016 13:35:40 +0000 (19:05 +0530)
committerMyungkyum Kim <myungyum.kim@samsung.com>
Tue, 15 Nov 2016 07:03:24 +0000 (16:03 +0900)
Change-Id: I39bbab477cc110756c60673e946ab7780ff2dfbb
Signed-off-by: Amritanshu Pandia <a.pandia1@samsung.com>
scripts_tpk/tpk-install.py
scripts_tpk/tpk_create.sh
scripts_tpk/tpkbuild.sh
scripts_tpk/tpksdk-install.py

index 6abd11a..feac496 100755 (executable)
@@ -14,7 +14,7 @@ import zipfile
 import gentestsxml
 from gentestsxml import *
 
-def copytpk(btype, module):
+def copytpk(btype, module,arch):
        if ( os.path.exists(TPK_DIR) == False ):
                os.makedirs(TPK_DIR)
 
@@ -23,7 +23,7 @@ def copytpk(btype, module):
        PKG_NAME=PKG_NAME+'-native-'+btype
        VER='1\.0\.0'
        PKG_VNAME=PKG_NAME+'-'+VER
-       PKG_VNAME=PKG_VNAME+'-arm'
+       PKG_VNAME=PKG_VNAME+'-'+arch
        FIND_FILE=PKG_VNAME+'\.tpk'
        for root, dirs, files in os.walk(os.getcwd()):
                for f in files:
@@ -55,31 +55,31 @@ def removeDir(path):
 
        return True
 
-def install(TYPE, MODNAME, PROFILE, TC_COUNT):
+def install(TYPE, MODNAME, PROFILE, TC_COUNT, ARCH):
        rpmCheck=False
        global INSTALL_PKG_COUNT
        if ( TYPE == None ):
-               install('ctc', None, PROFILE, TC_COUNT)
-               install('itc', None, PROFILE, TC_COUNT)
-               install('utc', None, PROFILE, TC_COUNT)
+               install('ctc', None, PROFILE, TC_COUNT, ARCH)
+               install('itc', None, PROFILE, TC_COUNT, ARCH)
+               install('utc', None, PROFILE, TC_COUNT, ARCH)
        else:
                if ( MODNAME == None ):
                        #os.chdir(WORKSPACE_DIR)
                        for root, dirs, files in os.walk(WORKSPACE_DIR):
                                for f in files:
-                                       r=re.search('^org\.tizen\.(?P<module_name>.*)-native-'+TYPE+'-1\.0\.0-arm\.tpk', f)
+                                       r=re.search('^org\.tizen\.(?P<module_name>.*)-native-'+TYPE+'-1\.0\.0-'+ARCH+'\.tpk', f)
                                        if ( r ):
-                                               install(TYPE, r.group('module_name'), PROFILE, TC_COUNT)
+                                               install(TYPE, r.group('module_name'), PROFILE, TC_COUNT, ARCH)
 
                else:
                        print('')
                        print('********************START Installing '+TYPE+':'+MODNAME+'**********************')
-                       copytpk(TYPE, MODNAME)
+                       copytpk(TYPE, MODNAME, ARCH)
                        os.chdir(PROJECT_DIR)
                        # setting variables
                        PKG_NAME='org.tizen.'+MODNAME+'-native-'+TYPE
                        VER='1.0.0'
-                       PKG_VNAME=PKG_NAME+'-'+VER+'-arm'
+                       PKG_VNAME=PKG_NAME+'-'+VER+'-'+ARCH
                        PKG_FNAME=PKG_VNAME+'.tpk'
                        if ( os.path.exists(TPK_DIR+dirSeparator+PKG_FNAME) == False):
                                sys.exit('Package Not Found '+PKG_VNAME)
@@ -222,17 +222,19 @@ if ( OS == 'Windows' ):
 
 PROJECT_DIR=(os.path.abspath(os.path.dirname(sys.argv[0])))
 TPK_DIR=os.getenv('HOME')+dirSeparator+'tpks'
-WORKSPACE_DIR=os.getenv('HOME')+dirSeparator+'workspace'+'_'+ sys.argv[1]
+WORKSPACE_DIR=os.getenv('HOME')+dirSeparator+'workspace'+'_'+ sys.argv[2]
 
 # TODO use argparse
 if ( len(sys.argv) >= 2 ):
-       profile=sys.argv[1]
+       arch=sys.argv[1]
 if ( len(sys.argv) >= 3 ):
-       tc_count=sys.argv[2]
+       profile=sys.argv[2]
 if ( len(sys.argv) >= 4 ):
-       build_ctype=sys.argv[3]
+       tc_count=sys.argv[3]
 if ( len(sys.argv) >= 5 ):
-       module=sys.argv[4]
+       build_ctype=sys.argv[4]
+if ( len(sys.argv) >= 6 ):
+       module=sys.argv[5]
 
 if ( os.path.exists('install.log') ):
        os.remove('install.log')
@@ -242,7 +244,7 @@ instLog.write('**********************************************\n')
 instLog.write('Following packages get installed successfully:\n')
 instLog.close()
 
-install(build_ctype, module, profile,tc_count)
+install(build_ctype, module, profile,tc_count, arch)
 
 if ( module == None ):
        instLog=open('install.log', 'a')
index ab8631d..3972a58 100755 (executable)
@@ -398,6 +398,7 @@ fi
 
 # build command properties
 COMPILER_TYPE="llvm"
+#COMPILER_TYPE="gcc"
 BUILD_TYPE="Debug"
 UNSUPPORTED_FILE="tct_unsupported.txt"
 
@@ -406,6 +407,10 @@ if [ "$ARCH_TYPE" == "arm" ]; then
        ARCH="armv7l"
 elif [ "$ARCH_TYPE" == "x86" ]; then
        ARCH="i586"
+elif [ "$ARCH_TYPE" == "aarch64" ]; then
+       ARCH="aarch64"
+elif [ "$ARCH_TYPE" == "x86_64" ]; then
+       ARCH="x86_64"
 fi
 
 SUPPORTED=`cat ./$UNSUPPORTED_FILE | grep "$PROFILE_TYPE:$ARCH:$TESTCASE_TYPE:$MODULE_NAME;"`
index 27e256f..86dfadf 100755 (executable)
@@ -27,7 +27,8 @@ function helpusage {
 # usage note
     echo "Usage: `basename $0` <build|install> <build_type> <module_name> <arch_type> <device_type>"
     echo "<build_type> = itc|ctc|utc"
-    echo "<arch_type> = arm|x86"
+    echo "<arch_type> = armv7l|i586 for 32bit architecture"
+    echo "<arch_type> = aarch64|x86_64 for 64bit architecture"
     echo "<device_type> = mobile|wearable"
     echo "commands description:"
     echo "       build                 performs SDK build"
@@ -53,12 +54,17 @@ else
        helpusage
 fi
 
-if   [ "$2" = "arm" ] || [ "$3" = "arm" ] || [ "$4" = "arm" ] || [ "$5" = "arm" ]; then
+if   [ "$2" = "armv7l" ] || [ "$3" = "armv7l" ] || [ "$4" = "armv7l" ] || [ "$5" = "armv7l" ]; then
        ARCH_TYPE="arm"
-elif [ "$2" = "x86" ] || [ "$3" = "x86"  ] || [ "$4" = "x86"  ] || [ "$5" = "x86"  ]; then
+elif [ "$2" = "i586" ] || [ "$3" = "i586"  ] || [ "$4" = "i586"  ] || [ "$5" = "i586"  ]; then
        ARCH_TYPE="x86"
+elif [ "$2" = "aarch64" ] || [ "$3" = "aarch64"  ] || [ "$4" = "aarch64"  ] || [ "$5" = "aarch64"  ]; then
+       ARCH_TYPE="aarch64"
+elif [ "$2" = "x86_64" ] || [ "$3" = "x86_64"  ] || [ "$4" = "x86_64"  ] || [ "$5" = "x86_64"  ]; then
+       ARCH_TYPE="x86_64"
 else
-       echo "Add argument 'architecture (arm or x86)'"
+       echo "Add argument '32 bit architecture (armv7l or i586)'"
+       echo "Add argument '64 bit architecture (aarch64 or x86_64)'"
        helpusage
 fi
 
@@ -125,12 +131,12 @@ function install {
        MOD_NAME=$2
         TC_COUNT=1
 
-       if [ "$ARCH_TYPE" == "arm" ]; then
+       if [ "$ARCH_TYPE" == "arm" ] || [ "$ARCH_TYPE" == "aarch64" ] ; then
                ln -sf ./scripts_tpk/tpk-install.py $PWD/tpk-install
-               python tpk-install $PROFILE_TYPE $TC_COUNT $TC_TYPE $MOD_NAME
-       elif [ "$ARCH_TYPE" == "x86" ]; then
+               python tpk-install $ARCH_TYPE $PROFILE_TYPE $TC_COUNT $TC_TYPE $MOD_NAME
+       elif [ "$ARCH_TYPE" == "x86" ] || [ "$ARCH_TYPE" == "x86_64" ] ; then
                ln -sf ./scripts_tpk/tpksdk-install.py $PWD/tpksdk-install
-               python tpksdk-install $PROFILE_TYPE $TC_COUNT $TC_TYPE $MOD_NAME
+               python tpksdk-install $ARCH_TYPE $PROFILE_TYPE $TC_COUNT $TC_TYPE $MOD_NAME
        fi
 
        if [ $INSTALL_CHILD == 1 ]; then 
@@ -151,10 +157,10 @@ function install_custom {
        MOD_NAME=$3
        TC_COUNT=$1
                
-       if [ "$ARCH_TYPE" == "arm" ]; then
+       if [ "$ARCH_TYPE" == "arm" ] || [ "$ARCH_TYPE" == "aarch64" ]; then
                ln -sf ./scripts_tpk/tpk-install.py $PWD/tpk-install
                python tpk-install $PROFILE_TYPE $TC_COUNT $TC_TYPE $MOD_NAME
-       elif [ "$ARCH_TYPE" == "x86" ]; then
+       elif [ "$ARCH_TYPE" == "x86" ] || [ "$ARCH_TYPE" == "x86_64" ] ; then
                ln -sf ./scripts_tpk/tpksdk-install.py $PWD/tpksdk-install
                python tpksdk-install $PROFILE_TYPE $TC_COUNT $TC_TYPE $MOD_NAME
        fi
index 0fbab9d..dec6388 100755 (executable)
@@ -14,7 +14,7 @@ import zipfile
 import gentestsxml
 from gentestsxml import *
 
-def copytpk(btype, module):
+def copytpk(btype, module,arch):
        if ( os.path.exists(TPK_DIR) == False ):
                os.makedirs(TPK_DIR)
 
@@ -23,7 +23,7 @@ def copytpk(btype, module):
        PKG_NAME=PKG_NAME+'-native-'+btype
        VER='1\.0\.0'
        PKG_VNAME=PKG_NAME+'-'+VER
-       PKG_VNAME=PKG_VNAME+'-'+ARCH
+       PKG_VNAME=PKG_VNAME+'-'+arch
        FIND_FILE=PKG_VNAME+'\.tpk'
        for root, dirs, files in os.walk(os.getcwd()):
                for f in files:
@@ -55,13 +55,13 @@ def removeDir(path):
 
        return True
 
-def install(TYPE, MODNAME, PROFILE, TC_COUNT):
+def install(TYPE, MODNAME, PROFILE, TC_COUNT, ARCH):
        rpmCheck=False
        global INSTALL_PKG_COUNT
        if ( TYPE == None ):
-               install('ctc', None, PROFILE, TC_COUNT)
-               install('itc', None, PROFILE, TC_COUNT)
-               install('utc', None, PROFILE, TC_COUNT)
+               install('ctc', None, PROFILE, TC_COUNT, ARCH)
+               install('itc', None, PROFILE, TC_COUNT, ARCH)
+               install('utc', None, PROFILE, TC_COUNT, ARCH)
        else:
                if ( MODNAME == None ):
                        #os.chdir(WORKSPACE_DIR)
@@ -69,12 +69,12 @@ def install(TYPE, MODNAME, PROFILE, TC_COUNT):
                                for f in files:
                                        r=re.search('^org\.tizen\.(?P<module_name>.*)-native-'+TYPE+'-1\.0\.0-'+ARCH+'\.tpk', f)
                                        if ( r ):
-                                               install(TYPE, r.group('module_name'), PROFILE, TC_COUNT)
+                                               install(TYPE, r.group('module_name'), PROFILE, TC_COUNT, ARCH)
 
                else:
                        print('')
                        print('********************START Installing '+TYPE+':'+MODNAME+'**********************')
-                       copytpk(TYPE, MODNAME)
+                       copytpk(TYPE, MODNAME, ARCH)
                        os.chdir(PROJECT_DIR)
                        # setting variables
                        PKG_NAME='org.tizen.'+MODNAME+'-native-'+TYPE
@@ -217,20 +217,25 @@ if ( OS == 'Windows' ):
 
 PROJECT_DIR=(os.path.abspath(os.path.dirname(sys.argv[0])))
 TPK_DIR=os.getenv('HOME')+dirSeparator+'tpks'
-WORKSPACE_DIR=os.getenv('HOME')+dirSeparator+'workspace'+'_'+ sys.argv[1]
-# this value doesnot change throughout
-ARCH='i386'
+WORKSPACE_DIR=os.getenv('HOME')+dirSeparator+'workspace'+'_'+ sys.argv[2]
 
 # TODO use argparse
 if ( len(sys.argv) >= 2 ):
-       profile=sys.argv[1]
+       arch=sys.argv[1]
 if ( len(sys.argv) >= 3 ):
-       tc_count=sys.argv[2]
+       profile=sys.argv[2]
 if ( len(sys.argv) >= 4 ):
-       build_ctype=sys.argv[3]
+       tc_count=sys.argv[3]
 if ( len(sys.argv) >= 5 ):
-       module=sys.argv[4]
+       build_ctype=sys.argv[4]
+if ( len(sys.argv) >= 6 ):
+       module=sys.argv[5]
 
+if ( arch == 'x86' ):
+       arch='i386'
+if ( arch == 'x86_64' ):
+       arch='x86_64'
+       
 if ( os.path.exists('install.log') ):
        os.remove('install.log')
 
@@ -239,7 +244,7 @@ instLog.write('**********************************************\n')
 instLog.write('Following packages get installed successfully:\n')
 instLog.close()
 
-install(build_ctype, module, profile,tc_count)
+install(build_ctype, module, profile,tc_count, arch)
 
 if ( module == None ):
        instLog=open('install.log', 'a')