From: Amritanshu Pandia Date: Fri, 11 Nov 2016 13:35:40 +0000 (+0530) Subject: [TCT][scripts_tpk][Non-ACR][Modification for 64 bit device and emulator / syncing... X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c0b5602fc5de7dfac39b2a0bf8f2281e7d5c68f0;p=test%2Ftct%2Fnative%2Fapi.git [TCT][scripts_tpk][Non-ACR][Modification for 64 bit device and emulator / syncing args with rpm approach] Change-Id: I39bbab477cc110756c60673e946ab7780ff2dfbb Signed-off-by: Amritanshu Pandia --- diff --git a/scripts_tpk/tpk-install.py b/scripts_tpk/tpk-install.py index 6abd11a..feac496 100755 --- a/scripts_tpk/tpk-install.py +++ b/scripts_tpk/tpk-install.py @@ -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.*)-native-'+TYPE+'-1\.0\.0-arm\.tpk', f) + r=re.search('^org\.tizen\.(?P.*)-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') diff --git a/scripts_tpk/tpk_create.sh b/scripts_tpk/tpk_create.sh index ab8631d..3972a58 100755 --- a/scripts_tpk/tpk_create.sh +++ b/scripts_tpk/tpk_create.sh @@ -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;"` diff --git a/scripts_tpk/tpkbuild.sh b/scripts_tpk/tpkbuild.sh index 27e256f..86dfadf 100755 --- a/scripts_tpk/tpkbuild.sh +++ b/scripts_tpk/tpkbuild.sh @@ -27,7 +27,8 @@ function helpusage { # usage note echo "Usage: `basename $0` " echo " = itc|ctc|utc" - echo " = arm|x86" + echo " = armv7l|i586 for 32bit architecture" + echo " = aarch64|x86_64 for 64bit architecture" echo " = 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 diff --git a/scripts_tpk/tpksdk-install.py b/scripts_tpk/tpksdk-install.py index 0fbab9d..dec6388 100755 --- a/scripts_tpk/tpksdk-install.py +++ b/scripts_tpk/tpksdk-install.py @@ -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.*)-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')