delete spaces in the file

This commit is contained in:
syureyi 2014-07-21 16:09:05 +08:00
parent a555639dd2
commit 69be28bd1b
3 changed files with 26 additions and 31 deletions

View File

@ -5,31 +5,31 @@ AUTO_TEST_SRC_PATH="../../../"
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}
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
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 @@ fi
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 @@ then
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 @@ then
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 @@ for dev in $devices; do
#delete the res
$ADB -s $dev shell rm -rf ${test_path}
done
done
}
for apk in ${apk_name};do
run_apk $apk;

View File

@ -28,9 +28,7 @@ runGetPerformanceInfo_openh264()
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 @@ runGetPerformanceInfo_openh264()
fi
if [[ $line =~ "H264 source file name" ]]
then
FileName=`echo $line | awk 'BEGIN {FS=":"} {print $'${seperatorNum}'}'`
if [ $1 = "ios" ]
then
@ -101,7 +98,6 @@ do
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}

View File

@ -23,7 +23,7 @@ elif [ $params = "dec" ];then
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 @@ if [ ! -d ./EncoderPerTestRes ]
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 @@ else
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}