improve the shell scripts

This commit is contained in:
syureyi 2014-08-07 15:43:08 +08:00
parent 4ebf8266a1
commit a5707738b7
4 changed files with 56 additions and 7 deletions

View File

@ -3,7 +3,13 @@
AUTO_TEST_ANDROID_PATH=`pwd`
AUTO_TEST_SRC_PATH="../../../"
AUTO_TEST_RES_PATH="${AUTO_TEST_ANDROID_PATH}/report"
if [ ! -d ${AUTO_TEST_RES_PATH} ]
then
mkdir -p ${AUTO_TEST_RES_PATH}
else
echo "Will delete those outdate xml in the report"
rm -f ${AUTO_TEST_RES_PATH}/*.xml
fi
#Prepare android build enviroment
echo please set the enviroment variable as:
echo export ANDROID_HOME="path of android sdk"

View File

@ -62,6 +62,7 @@ IOS_MAKE_PARAMS="OS=ios ARCH=${CODEC_TEST_IOS_ARCH}"
############make build
find ./ -name *.o -exec rm -rf {} \;
find ./ -name *.d -exec rm -rf {} \;
rm -f *.so
make clean
make ${IOS_MAKE_PARAMS} test
echo "Codec test will run on ${CODEC_TEST_IOS_PLATFORM} with ${CODEC_TEST_IOS_DEBUG_RELEASE}"
@ -134,6 +135,9 @@ CODEC_TEST_IOS_REPORT_PATH="${AUTO_TEST_IOS_PATH}/report"
if [ ! -d ${CODEC_TEST_IOS_REPORT_PATH} ]
then
mkdir -p ${CODEC_TEST_IOS_REPORT_PATH}
else
echo "Will delete those outdate xml in the report"
rm -f ${CODEC_TEST_IOS_REPORT_PATH}/*.xml
fi
#start to run unittest,default run the xcode at arch armv7 with release

View File

@ -22,7 +22,34 @@ parse_unittest() {
msg="Total testcases: $tests, failed: $fails,time:$waste seconds, at$times,xml:$res"
echo ${msg}
UT_Failed_Num=$((${UT_Failed_Num}+${fails}))
fi
cat >> mail.log << EOF
<style>
.fail {
background-color: yellow;
}
</style>
<br>
<table style="width:600px" cellspacing="0" border="1" width="100%">
<thead>
<tr>
<td>Total unit test cases</td>
<td>Failed</td>
<td>Time</td>
<td>Date</td>
</tr>
</thead>
<tbody>
<tr style="text-align:center; font-weight: bold;">
<td>${tests}</td>
<td><font class="fail">${fails}</font></td>
<td>${waste}</td>
<td>${times}</td>
</tr>
</tbody>
</table>
<br>
EOF
fi
}
xmlcount=`ls $REPORT | wc -l`

View File

@ -19,7 +19,7 @@ ANDROID_SDK_PATH=${ANDROID_HOME}
ANDROID_NDK_PATH=${ANDROID_NDK_HOME}
if [ "#${ANDROID_SDK_PATH}" = "#" ]
then
echo Please set ANDROID_HOME with the path of Android SDK
echo Please set ANDROID_HOME with the path of Android SDK
exit 1
fi
if [ "#${ANDROID_NDK_PATH}" = "#" ]
@ -38,11 +38,13 @@ else
echo Start to run the unittest on android devices
ANDROID=1
cd ./android
bash run_AutoTest_android.sh
cd ${AUTO_TEST_PATH}
bash run_AutoTest_android.sh >/dev/null 2>&1
if [ $? -ne 0 ];then
echo There is something wrong happened when runing unittest on android devices,please to check
else
echo Finish run the unittest on android devices sucessfully
fi
cd ${AUTO_TEST_PATH}
fi
#To find whether have ios devices
@ -54,15 +56,24 @@ else
echo Start to run the unittest on ios devices
IOS=1
cd ./ios
bash run_AutoTest_ios.sh
cd ${AUTO_TEST_PATH}
bash run_AutoTest_ios.sh >/dev/null 2>&1
if [ $? -ne 0 ];then
echo There is something wrong happened when runing unittest on ios devices,please to check
fi
else
echo Finish run the unittest on android devices sucessfully
fi
cd ${AUTO_TEST_PATH}
fi
#To parse the unit test result file to find whether have failures
if [ ${ANDROID} = "1" ];then
echo "
<style>
.env {
background-color: #95B9C7;
font: 30px bold;
}</style>">>mail.log
echo "<br><font class="env">Run unit test on android devices</font>">>mail.log
bash run_ParseUTxml.sh ./android/report
ret=$?
if [ ${ret} -eq 0 ];then
@ -74,6 +85,7 @@ echo Unit test run failed
fi
fi
if [ ${IOS} = "1" ];then
echo "<br><font class="env">Run unit test on ios devices with armv7 & arm64</font>">>mail.log
bash run_ParseUTxml.sh ./ios/report
ret=$?
if [ $ret -eq 0 ];then