sg481n | bd890c5 | 2017-08-28 12:11:35 -0400 | [diff] [blame] | 1 | #!/bin/bash |
| 2 | |
| 3 | # For Jenkins, we need to keep track of the exit code returned from each tc run; |
| 4 | # if it's ever non-zero (ie, a failure), must return that value when this script exits |
| 5 | # |
| 6 | STATUS=0 |
| 7 | |
| 8 | for DIR in `ls | grep ^TC_ | sort`; do |
| 9 | echo "**" | tee reports/$DIR.txt |
| 10 | echo "** TC Group: $DIR" | tee -a reports/$DIR.txt |
| 11 | echo "** Date : "`date` | tee -a reports/$DIR.txt |
| 12 | echo "** By : "`who | cut -d " " -f 1` | tee -a reports/$DIR.txt |
| 13 | echo "**" | tee -a reports/$DIR.txt |
| 14 | echo "" >> reports/$DIR.txt |
| 15 | echo "-- Description --" >> reports/$DIR.txt |
| 16 | cat $DIR/Description >> reports/$DIR.txt |
| 17 | echo -- Positive Cases -- >> reports/$DIR.txt |
| 18 | grep -h "^# $DIR.*POS " $DIR/[0-9]* | cut -d ' ' -f 2- | sed -e 's/ / /' >> reports/$DIR.txt |
| 19 | echo >> reports/$DIR.txt |
| 20 | echo -- Negative Cases -- >> reports/$DIR.txt |
| 21 | grep -h "^# $DIR.*NEG " $DIR/[0-9]* | cut -d ' ' -f 2- | sed -e 's/ / /' >> reports/$DIR.txt |
| 22 | |
| 23 | |
| 24 | echo "" >> reports/$DIR.txt |
| 25 | echo "-- Results" | tee -a reports/$DIR.txt |
| 26 | echo "" | tee -a reports/$DIR.txt |
| 27 | |
| 28 | bash ./tc $DIR | tee -a reports/$DIR.txt |
| 29 | |
| 30 | if [[ ${PIPESTATUS[0]} -ne 0 ]]; then |
| 31 | STATUS=1 |
| 32 | fi |
| 33 | done |
| 34 | |
| 35 | |
| 36 | exit $STATUS |
| 37 | |
| 38 | |