test-all.sh 1.5 KB
Newer Older
sangshuduo's avatar
sangshuduo 已提交
1 2 3 4 5 6 7 8 9
#!/bin/bash

# Color setting
RED='\033[0;31m'
GREEN='\033[1;32m'
GREEN_DARK='\033[0;32m'
GREEN_UNDERLINE='\033[4;32m'
NC='\033[0m'

10
echo "### run TSIM script ###"
sangshuduo's avatar
sangshuduo 已提交
11
cd script
12
./test.sh -f basicSuite.sim 2>&1 | grep 'success\|failed\|fault' | grep -v 'default' | tee out.log
sangshuduo's avatar
sangshuduo 已提交
13

14 15
totalSuccess=`grep 'success' out.log | wc -l`
totalBasic=`grep success out.log | grep Suite | wc -l`
sangshuduo's avatar
sangshuduo 已提交
16

17 18
if [ "$totalSuccess" -gt "0" ]; then
  totalSuccess=`expr $totalSuccess - $totalBasic`
sangshuduo's avatar
sangshuduo 已提交
19 20
fi

21 22
echo -e "${GREEN} ### Total $totalSuccess TSIM case(s) succeed! ### ${NC}"

23
totalFailed=`grep 'failed\|fault' out.log | wc -l`
24
# echo -e "${RED} ### Total $totalFailed TSIM case(s) failed! ### ${NC}"
25

26
if [ "$totalFailed" -ne "0" ]; then
27 28 29
  echo -e "${RED} ### Total $totalFailed TSIM case(s) failed! ### ${NC}"

#  exit $totalFailed
sangshuduo's avatar
sangshuduo 已提交
30 31
fi

32
echo "### run Python script ###"
sangshuduo's avatar
sangshuduo 已提交
33
cd ../pytest
34 35

if [ "$1" == "cron" ]; then
36
  ./fulltest.sh 2>&1 | grep 'successfully executed\|failed\|fault' | grep -v 'default'| tee pytest-out.log
37
else
38
  ./smoketest.sh 2>&1 | grep 'successfully executed\|failed\|fault' | grep -v 'default'| tee pytest-out.log
39
fi
40
totalPySuccess=`grep 'successfully executed' pytest-out.log | wc -l`
sangshuduo's avatar
sangshuduo 已提交
41

42 43
if [ "$totalPySuccess" -gt "0" ]; then
  echo -e "${GREEN} ### Total $totalPySuccess python case(s) succeed! ### ${NC}"
sangshuduo's avatar
sangshuduo 已提交
44 45
fi

46
totalPyFailed=`grep 'failed\|fault' pytest-out.log | wc -l`
47 48
if [ "$totalPyFailed" -ne "0" ]; then
  echo -e "${RED} ### Total $totalPyFailed python case(s) failed! ### ${NC}"
49
#  exit $totalPyFailed
sangshuduo's avatar
sangshuduo 已提交
50 51
fi

52
exit $(($totalFailed + $totalPyFailed))