ref: 69be28bd1b80d99857074a4b0074ac667fe2488e
parent: a555639dd2e252a09a57d64a8e52ec46ed27dfa6
author: syureyi <lingzhu2@cisco.com>
date: Mon Jul 21 12:09:05 EDT 2014
delete spaces in the file
--- a/autotest/performaceTest/android/run_AutoTest_android.sh
+++ b/autotest/performaceTest/android/run_AutoTest_android.sh
@@ -5,8 +5,8 @@
AUTO_TEST_RES_PATH="${AUTO_TEST_ANDROID_PATH}/report" mkdir -p ${AUTO_TEST_RES_PATH}#Prepare android build enviroment
-echo please set the enviroment variable as:
-echo export ANDROID_HOME="path of android sdk"
+echo please set the enviroment variable as:
+echo export ANDROID_HOME="path of android sdk"
echo export ANDROID_NDK_HOME="path of android ndk"
ANDROID_SDK_PATH=${ANDROID_HOME} ANDROID_NDK_PATH=${ANDROID_NDK_HOME}@@ -13,13 +13,13 @@
ANDROID_MAKE_PARAMS="OS=android NDKROOT=${ANDROID_NDK_PATH} TARGET=android-19" if [ "#${ANDROID_SDK_PATH}" = "#" ]-then
-echo Please set ANDROID_HOME with the path of Android SDK
+then
+echo Please set ANDROID_HOME with the path of Android SDK
exit 1
fi
if [ "#${ANDROID_NDK_PATH}" = "#" ]then
-echo Please set ANDROID_NDK_HOME with the path of Android NDK
+echo Please set ANDROID_NDK_HOME with the path of Android NDK
exit 1
fi
#make build
@@ -26,10 +26,10 @@
cd ${AUTO_TEST_SRC_PATH} find ./ -name *.o -exec rm -f {} \; find ./ -name *.d -exec rm -f {} \;-make $ANDROID_MAKE_PARAMS
+make $ANDROID_MAKE_PARAMS
if [ $? -ne 0 ]
-then
+then
echo Build error,check with the trace of make
exit 1
fi
@@ -59,13 +59,13 @@
ADB=${ANDROID_SDK_PATH}/platform-tools/adb#get devices
-devices=`$ADB devices | awk -F" " '/\tdevice/{print $1}'` -if [ "#$devices" = "#" ];then
- echo "Have not any android devices."
- exit 1
-fi
-
-#run apk
+devices=`$ADB devices | awk -F" " '/\tdevice/{print $1}'`+if [ "#$devices" = "#" ];then
+ echo "Have not any android devices."
+ exit 1
+fi
+
+#run apk
run_apk() {local apk=$1;
local rand=` date +%s`
@@ -78,7 +78,7 @@
log_grep_params="welsdec"
test_res=${AUTO_TEST_ANDROID_PATH}/../DecoderPerfTestRes report_file=${AUTO_TEST_RES_PATH}/decPerf_${rand}-
+
fi
if [[ "${apk}" =~ "WelsEncTest-debug.apk" ]]then
@@ -90,17 +90,17 @@
report_file=${AUTO_TEST_RES_PATH}/encPerf_${rand}fi
-for dev in $devices; do
- dev_info_file=${AUTO_TEST_RES_PATH}/${dev}.log - $ADB -s $dev uninstall ${apk_id} +for dev in $devices; do
+ dev_info_file=${AUTO_TEST_RES_PATH}/${dev}.log+ $ADB -s $dev uninstall ${apk_id} $ADB -s $dev install -r ${apk}#TODO: output more info about android device such as name,cpu,memory,and also power comsumption.
echo `$ADB -s $dev shell cat /system/build.prop |grep ro.product.model | awk -F"=" '{print $2}'`>${dev_info_file}#push resources
- $ADB -s $dev push ${test_res} ${test_path} - #before start logcat,kill logcat
- pid=`$ADB -s $dev shell ps | grep logcat | awk '{print $2;}'` - [ "#$pid" != "#" ] && $ADB -s $dev shell kill $pid >/dev/null
+ $ADB -s $dev push ${test_res} ${test_path}+ #before start logcat,kill logcat
+ pid=`$ADB -s $dev shell ps | grep logcat | awk '{print $2;}'`+ [ "#$pid" != "#" ] && $ADB -s $dev shell kill $pid >/dev/null
$ADB -s $dev logcat -c
$ADB -s $dev logcat |grep ${log_grep_params} >${report_file}_${dev}.log & $ADB -s $dev shell am start -n ${apk_main}@@ -121,7 +121,7 @@
#delete the res
$ADB -s $dev shell rm -rf ${test_path}-done
+done
}
for apk in ${apk_name};dorun_apk $apk;
--- a/autotest/performaceTest/parsePerfData.sh
+++ b/autotest/performaceTest/parsePerfData.sh
@@ -28,9 +28,7 @@
do
if [[ $line =~ "enc yuv file" ]]
then
-
FileName=`echo $line | awk 'BEGIN {FS="enc yuv file"} {print $2}'`-
FileName=`echo $FileName | awk 'BEGIN {FS=":"} {print $2}'` fi
if [[ $line =~ "Width" ]]
@@ -62,7 +60,6 @@
fi
if [[ $line =~ "H264 source file name" ]]
then
-
FileName=`echo $line | awk 'BEGIN {FS=":"} {print $'${seperatorNum}'}'`if [ $1 = "ios" ]
then
@@ -101,7 +98,6 @@
PerformFile=`echo $log |awk -F"." '{print $1}'` PerformFile=${PerformFile}_${suffix}.csv#inital perfermance file
-
echo "$log,,,">>${AUTO_TEST_RESULT_PATH}${PerformFile} echo "YUV,Resolution,Encodedframes,FPS">>${AUTO_TEST_RESULT_PATH}${PerformFile} runGetPerformanceInfo_openh264 ${suffix} ${Result_log_path}${log}>>${AUTO_TEST_RESULT_PATH}${PerformFile}--- a/autotest/performaceTest/run_perfTest.sh
+++ b/autotest/performaceTest/run_perfTest.sh
@@ -23,7 +23,7 @@
echo Running the decoder performance test
ENC=0
else
- echo parameters are illegal!!!, ${0} [ios/android] [enc/dec]. + echo parameters are illegal!!!, ${0} [ios/android] [enc/dec] exit 1
fi
done
@@ -36,8 +36,7 @@
then
mkdir -p ./EncoderPerfTestRes
fi
-
-if [ "#`ls ./EncoderPerfTestRes`" = "#" ]
+if [ "#`ls ./EncoderPerfTestRes`" = "#" ]
then
echo put yuv and cfg file into ./EncoderPerfTest folder as
echo case_720p
@@ -54,7 +53,7 @@
if [ ${IOS} = "1" ]then
echo xxxxxxxxxxxxxxxxIOS ENC Startxxxxxxxxxxxxxxxxxx
-echo Run the Encoder performance test on ios devices
+echo Run the Encoder performance test on ios devices
cd ./ios
bash run_AutoTest_ios.sh enc
cd ${AUTO_TEST_PATH}--
⑨