<test>exit when test case failed

This commit is contained in:
liuyq-617 2020-11-17 14:05:03 +08:00
parent 3b32087098
commit 9219ffd838
1 changed files with 8 additions and 0 deletions

View File

@ -16,6 +16,10 @@ function runSimCaseOneByOne {
./test.sh -f $case > /dev/null 2>&1 && \ ./test.sh -f $case > /dev/null 2>&1 && \
echo -e "${GREEN}$case success${NC}" | tee -a out.log || \ echo -e "${GREEN}$case success${NC}" | tee -a out.log || \
echo -e "${RED}$case failed${NC}" | tee -a out.log echo -e "${RED}$case failed${NC}" | tee -a out.log
out_log=`tail -1 out.log `
if [[ $out_log =~ 'failed' ]];then
exit 8
fi
end_time=`date +%s` end_time=`date +%s`
echo execution time of $case was `expr $end_time - $start_time`s. | tee -a out.log echo execution time of $case was `expr $end_time - $start_time`s. | tee -a out.log
fi fi
@ -37,6 +41,10 @@ function runPyCaseOneByOne {
echo -e "${GREEN}$case success${NC}" | tee -a pytest-out.log || \ echo -e "${GREEN}$case success${NC}" | tee -a pytest-out.log || \
echo -e "${RED}$case failed${NC}" | tee -a pytest-out.log echo -e "${RED}$case failed${NC}" | tee -a pytest-out.log
end_time=`date +%s` end_time=`date +%s`
out_log=`tail -1 pytest-out.log `
if [[ $out_log =~ 'failed' ]];then
exit 8
fi
echo execution time of $case was `expr $end_time - $start_time`s. | tee -a pytest-out.log echo execution time of $case was `expr $end_time - $start_time`s. | tee -a pytest-out.log
else else
$line > /dev/null 2>&1 $line > /dev/null 2>&1