1#!bin/bash 2IOS=1 3ANDROID=1 4ENC=1 5DEC=1 6AUTO_TEST_PATH=`pwd` 7 8#Judge to run the test on which kind of mobile 9if [ $# -eq 0 ];then 10echo Default testing will run on android and ios devices meanwhile 11else 12for params in $*; do 13if [ $params = "ios" ];then 14 echo Running the test just on ios devices 15 ANDROID=0 16elif [ $params = "android" ];then 17 echo Running the test just on android devices 18 IOS=0 19elif [ $params = "enc" ];then 20 echo Running the encoder performance test 21 DEC=0 22elif [ $params = "dec" ];then 23 echo Running the decoder performance test 24 ENC=0 25else 26 echo parameters are illegal!!!, ${0} [ios/android] [enc/dec] 27 exit 1 28fi 29done 30fi 31 32#Prepare encoder resources 33if [ ${ENC} = "1" ] 34then 35if [ ! -d ./EncoderPerTestRes ] 36then 37mkdir -p ./EncoderPerfTestRes 38fi 39if [ "#`ls ./EncoderPerfTestRes`" = "#" ] 40then 41echo put yuv and cfg file into ./EncoderPerfTest folder as 42echo case_720p 43echo case_720p/welsenc.cfg 44echo case_720p/layer2.cfg 45echo case_720p/yuv 46echo case_720p/yuv/xxx1.yuv 47echo case_720p/yuv/xxx2.yuv 48echo case_360p 49echo case_360p/welsenc.cfg 50echo ...... 51else 52#Run the encoder performance test 53if [ ${IOS} = "1" ] 54then 55echo xxxxxxxxxxxxxxxxIOS ENC Startxxxxxxxxxxxxxxxxxx 56echo Run the Encoder performance test on ios devices 57cd ./ios 58bash run_AutoTest_ios.sh enc 59cd ${AUTO_TEST_PATH} 60fi 61 62if [ ${ANDROID} = "1" ] 63then 64echo xxxxxxxxxxxxxxAndroid ENC Startxxxxxxxxxxxxxxxxxxxx 65echo Run the Encoder performance test on android devices 66cd ./android 67bash run_AutoTest_android.sh enc 68cd ${AUTO_TEST_PATH} 69fi 70fi 71fi 72 73#Prepare decoder resources 74if [ ${DEC} = "1" ] 75then 76if [ ! -d ./DecoderPerfTestRes ] 77then 78mkdir -p ./DecoderPerfTestRes 79fi 80 81if [ "#`ls ./DecoderPerfTestRes`" = "#" ] 82then 83echo put decoded bitstreams into such folder as 84echo xxx1.264 85echo xxx2.264 86echo ........ 87else 88#Run the decoder performance test 89if [ ${IOS} = "1" ] 90then 91echo xxxxxxxxxxxxxxxxIOS DEC Startxxxxxxxxxxxxxxxxxx 92echo Run the Decoder performance test on ios devices 93cd ./ios 94bash run_AutoTest_ios.sh dec 95cd ${AUTO_TEST_PATH} 96fi 97 98if [ ${ANDROID} = "1" ] 99then 100echo xxxxxxxxxxxxxxAndroid DEC Startxxxxxxxxxxxxxxxxxxxx 101echo Run the Decoder performance test on android devices 102cd ./android 103bash run_AutoTest_android.sh dec 104cd ${AUTO_TEST_PATH} 105fi 106fi 107fi 108 109#TODO:NOW just generate csv file to display performance data 110cd ${AUTO_TEST_PATH} 111if [[ "#`ls ./ios/report`" == "#" && "#`ls ./android/report`" == "#" ]] 112then 113echo There is nothing result log generated at ios or android devices 114else 115echo Start to generate test result csv file 116#Test result 117mkdir -p ./TestResultCSV 118bash parsePerfData.sh 119echo The csv file locate ./TestResultCSV/xxx.csv 120fi 121 122 123