Skip to content

Commit bda79d8

Browse files
author
George Gayno
committed
Added comments and minor logic updates to rt.summary.sh.
Fixes #1016
1 parent 92df3b8 commit bda79d8

File tree

1 file changed

+33
-13
lines changed

1 file changed

+33
-13
lines changed

reg_tests/cpld_gridgen/rt.summary.sh

+33-13
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,55 @@
11
#!/bin/bash
22

3-
set -x
3+
set -eux
4+
5+
#--------------------------------------------------------------------------
6+
# This script runs once all tests have completed. It checks for
7+
# failed tests and creates some final log files.
8+
#--------------------------------------------------------------------------
49

510
cd $PATHRT
611

7-
rm -f fail_test
12+
#--------------------------------------------------------------------------
13+
# If there are any failed tests, combine the log files into one log
14+
# called 'fail_test'.
15+
#--------------------------------------------------------------------------
16+
17+
rm -f failed_tests
818
FAIL_FILES="fail_test_*"
919
for file in $FAIL_FILES; do
1020
if [[ -f "$file" ]]; then
11-
cat "$file" >> fail_test
21+
cat "$file" >> failed_tests
22+
rm -f $file
1223
fi
1324
done
1425

15-
rm -f RegressionTests_$target.$compiler.log
26+
#--------------------------------------------------------------------------
27+
# Combine the run logs for each test into one log.
28+
#--------------------------------------------------------------------------
29+
30+
LOG_FILE=RegressionTests_${target}.${compiler}.log
31+
rm -f $LOG_FILE
1632
for file in RegressionTests_$target.${compiler}.*.log
1733
do
1834
if [[ -f "$file" ]]; then
19-
cat "$file" >> RegressionTests_$target.$compiler.log
35+
cat "$file" >> $LOG_FILE
2036
rm -f $file
2137
fi
2238
done
2339

40+
#--------------------------------------------------------------------------
41+
# Summarize the results in summary.log.
42+
#--------------------------------------------------------------------------
43+
2444
rm -f summary.log
25-
if [[ -e fail_test ]]; then
26-
echo | tee -a RegressionTests_$target.$compiler.log
27-
for file in fail_test_*; do
28-
cat $file >>RegressionTests_$target.$compiler.log
29-
cat $file >>summary.log
30-
done
45+
if [[ -e "failed_tests" ]]; then
46+
echo | tee -a $LOG_FILE
47+
cat failed_tests >>$LOG_FILE
48+
cat failed_tests >>summary.log
3149
else
32-
echo | tee -a RegressionTests_$target.$compiler.log
33-
echo "REGRESSION TEST WAS SUCCESSFUL" | tee -a RegressionTests_$target.$compiler.log
50+
echo | tee -a $LOG_FILE
51+
echo "REGRESSION TEST WAS SUCCESSFUL" | tee -a $LOG_FILE
3452
echo "All tests passed" >>summary.log
3553
fi
54+
55+
exit 0

0 commit comments

Comments
 (0)