Skip to content

Commit

Permalink
Added comments and minor logic updates to rt.summary.sh.
Browse files Browse the repository at this point in the history
Fixes #1016
  • Loading branch information
George Gayno committed Feb 28, 2025
1 parent 92df3b8 commit bda79d8
Showing 1 changed file with 33 additions and 13 deletions.
46 changes: 33 additions & 13 deletions reg_tests/cpld_gridgen/rt.summary.sh
Original file line number Diff line number Diff line change
@@ -1,35 +1,55 @@
#!/bin/bash

set -x
set -eux

#--------------------------------------------------------------------------
# This script runs once all tests have completed. It checks for
# failed tests and creates some final log files.
#--------------------------------------------------------------------------

cd $PATHRT

rm -f fail_test
#--------------------------------------------------------------------------
# If there are any failed tests, combine the log files into one log
# called 'fail_test'.
#--------------------------------------------------------------------------

rm -f failed_tests
FAIL_FILES="fail_test_*"
for file in $FAIL_FILES; do
if [[ -f "$file" ]]; then
cat "$file" >> fail_test
cat "$file" >> failed_tests
rm -f $file
fi
done

rm -f RegressionTests_$target.$compiler.log
#--------------------------------------------------------------------------
# Combine the run logs for each test into one log.
#--------------------------------------------------------------------------

LOG_FILE=RegressionTests_${target}.${compiler}.log
rm -f $LOG_FILE
for file in RegressionTests_$target.${compiler}.*.log
do
if [[ -f "$file" ]]; then
cat "$file" >> RegressionTests_$target.$compiler.log
cat "$file" >> $LOG_FILE
rm -f $file
fi
done

#--------------------------------------------------------------------------
# Summarize the results in summary.log.
#--------------------------------------------------------------------------

rm -f summary.log
if [[ -e fail_test ]]; then
echo | tee -a RegressionTests_$target.$compiler.log
for file in fail_test_*; do
cat $file >>RegressionTests_$target.$compiler.log
cat $file >>summary.log
done
if [[ -e "failed_tests" ]]; then
echo | tee -a $LOG_FILE
cat failed_tests >>$LOG_FILE
cat failed_tests >>summary.log
else
echo | tee -a RegressionTests_$target.$compiler.log
echo "REGRESSION TEST WAS SUCCESSFUL" | tee -a RegressionTests_$target.$compiler.log
echo | tee -a $LOG_FILE
echo "REGRESSION TEST WAS SUCCESSFUL" | tee -a $LOG_FILE
echo "All tests passed" >>summary.log
fi

exit 0

0 comments on commit bda79d8

Please sign in to comment.