自动测试脚本 continuous test

#要考虑的几点:

1. 保存到log, 最好命令、输出以及错误都重定向到文件中(同时显示到屏幕),将log软连接到latest,方便每次查看

2. 每一步的结果都要校验并做对应处理(提示出错,或者自动做某些work)

3. 结果报告,理论上可以通过远程的IP查出用户,并发对应邮件(但是不要发太多的邮件,例行的发,偶然的结果不用发)

4. 持续更新中。。。

 

#########################################################################
#
# Name:     ci ( Continuous Integration)
# Purpose:  It aims to continuously improve the quality of the product, and
#           it also could be used to verify the code before the code are submit
#           to svn.
#
#########################################################################

## Prepare the code
LOG=log-`date +%m%d%y-%H%M%S`
ln -s $LOG latest
set -v
exec 2>&1 1>> $LOG                      //用此方法导致当前的输出重定向到别的文件中,中间子进程不能再打开log文件做其他处理(exec不能跟tee管道组合)
#rm -rf dx2_linux
#svn update
if [ $? -eq 1 ]
then
   echo "svn update failed"
   exit 1
fi

cd dx2_linux

make clean
if [ $? -eq 1 ]
then
   echo "make clean failed"
   exit 1
fi

make
if [ $? -eq 1 ]
then
   echo "make failed"
   exit 1
fi

sh Load
if [ $? -eq 1 ]
then
   echo "Load failed"
   exit 1
fi

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值