| 43 |
#git_repo='altMITgcm'; #git_code='MITgcm66h' |
#git_repo='altMITgcm'; #git_code='MITgcm66h' |
| 44 |
#- other settings: |
#- other settings: |
| 45 |
tmpFil="/tmp/"`basename $0`".$$" |
tmpFil="/tmp/"`basename $0`".$$" |
| 46 |
|
logFile='check_update.log' |
| 47 |
sendCmd='-a jm_c@mitgcm.org' |
sendCmd='-a jm_c@mitgcm.org' |
| 48 |
sendCmd='-send scp -a jm_c@mitgcm.org:testing/MITgcm-test' |
sendCmd='-send scp -a jm_c@mitgcm.org:testing/MITgcm-test' |
| 49 |
|
|
|
gcmDIR="MITgcm" |
|
|
logFile='check_update.log' |
|
| 50 |
echo "-- run: \""`basename $0` $*"\" on:" `date` >> $logFile |
echo "-- run: \""`basename $0` $*"\" on:" `date` >> $logFile |
| 51 |
if test -e $gcmDIR/.git/config -a -f git_Hash ; then |
gcmDIR="MITgcm" |
| 52 |
mv git_Hash prevHash |
if test -e $gcmDIR/.git/config ; then : ; else |
| 53 |
( cd $gcmDIR ; git pull > /dev/null ) |
echo " No current clone ==> get a fresh clone" >> $logFile |
| 54 |
( cd $gcmDIR ; git rev-parse HEAD > ../git_Hash ) |
#rm -f git_Hash prevHash |
|
else |
|
|
echo " No current clone or missing file "git_Hash" ==> get a fresh clone" >> $logFile |
|
|
rm -f prevHash |
|
| 55 |
if test -d $gcmDIR ; then /bin/rm -rf $gcmDIR ; fi |
if test -d $gcmDIR ; then /bin/rm -rf $gcmDIR ; fi |
| 56 |
git clone https://github.com/$git_repo/${git_code}.git $gcmDIR |
git clone https://github.com/$git_repo/${git_code}.git $gcmDIR |
| 57 |
( cd $gcmDIR ; git rev-parse HEAD > ../git_Hash ) |
( cd $gcmDIR ; git rev-parse HEAD > ../git_Hash ) |
| 61 |
#-- check particular set of tests: |
#-- check particular set of tests: |
| 62 |
if test $1 = tap ; then |
if test $1 = tap ; then |
| 63 |
#- Only run this pair of test if MITgcm code got updated: |
#- Only run this pair of test if MITgcm code got updated: |
| 64 |
if test -f prevHash ; then |
if test -f git_Hash -a -f prevHash ; then |
| 65 |
#ls -l prevHash >> $logFile |
#ls -l prevHash >> $logFile |
| 66 |
diff -q git_Hash prevHash > /dev/null 2>&1 |
diff -q git_Hash prevHash > /dev/null 2>&1 |
| 67 |
retv=$? |
retv=$? |
| 78 |
else |
else |
| 79 |
echo " No file 'prevHash' --> will run '$1' set of tests" >> $logFile |
echo " No file 'prevHash' --> will run '$1' set of tests" >> $logFile |
| 80 |
fi |
fi |
| 81 |
|
elif test $1 = gfort ; then |
| 82 |
|
#- to force to skip "tap" test while "gfort" is running: |
| 83 |
|
if test -f prevHash ; then |
| 84 |
|
cp -p prevHash git_Hash |
| 85 |
|
else |
| 86 |
|
cp -p git_Hash prevHash |
| 87 |
|
fi |
| 88 |
fi |
fi |
| 89 |
|
|
| 90 |
echo "run: \""`basename $0` $*"\" on:" `date` |
echo "run: \""`basename $0` $*"\" on:" `date` |
| 106 |
for tt in $tst_list |
for tt in $tst_list |
| 107 |
do |
do |
| 108 |
echo $tt | grep '^tap' > /dev/null 2>&1 ; retv=$? |
echo $tt | grep '^tap' > /dev/null 2>&1 ; retv=$? |
| 109 |
if [ $retv -ne 0 ] ; then |
if [ $retv -ne 0 ] ; then |
| 110 |
echo $tt | grep '^g' > /dev/null 2>&1 ; retv=$? |
echo $tt | grep '^g' > /dev/null 2>&1 ; retv=$? |
| 111 |
fi |
fi |
| 112 |
if [ $retv -eq 0 -a $gfort -ge 1 ] ; then gfort=2 |
if [ $retv -eq 0 -a $gfort -ge 1 ] ; then gfort=2 |
| 137 |
rm -f tr_clean_$tt.log |
rm -f tr_clean_$tt.log |
| 138 |
echo $tt | grep '^.ad' > /dev/null 2>&1 ; fwd=$? |
echo $tt | grep '^.ad' > /dev/null 2>&1 ; fwd=$? |
| 139 |
echo $tt | grep '^tap' > /dev/null 2>&1 ; tap=$? |
echo $tt | grep '^tap' > /dev/null 2>&1 ; tap=$? |
| 140 |
if test $tt = g7a -o $tap = 0 ; then fwd=0 ; clOpt='-adm' ; fi |
if test $tt = g7a ; then fwd=0 ; fi |
| 141 |
echo " testing tt= $tt , fwd= $fwd" |
echo " testing tt= $tt , fwd= $fwd , tap= $tap" |
| 142 |
if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then |
if test -e $gcmDIR/.git/config -a -d $gcmDIR/verification ; then |
| 143 |
#- cleaning previous testreport run and updating the code: |
#- cleaning previous testreport run and updating the code: |
| 144 |
if [ $fwd -eq 0 ] ; then |
if [ $fwd -eq 0 -o $tap -eq 0 ] ; then |
| 145 |
if test $tt = 'tapAD' ; then clOpt='-tap -adm' ; fi |
if test $tt = 'tapTL' ; then clOpt='-tlm' ; else clOpt='-adm' ; fi |
| 146 |
if test $tt = 'tapTL' ; then clOpt='-tap -tlm' ; fi |
if [ $tap -eq 0 ] ; then clOpt="-tap $clOpt" ; fi |
| 147 |
set -x |
set -x |
| 148 |
#- cleanup previous test: |
#- cleanup previous test: |
| 149 |
( cd $gcmDIR/verification ; ./testreport $clOpt -clean > ../../tr_clean_$tt.log 2>&1 ) |
( cd $gcmDIR/verification ; ./testreport $clOpt -clean > ../../tr_clean_$tt.log 2>&1 ) |
| 418 |
fi |
fi |
| 419 |
|
|
| 420 |
done |
done |
| 421 |
|
|
| 422 |
|
if test $1 = gfort ; then |
| 423 |
|
day=`date +%d` |
| 424 |
|
echo " day in the month='${day}'" |
| 425 |
|
if test $day = 01 -a -f git_Hash ; then |
| 426 |
|
ls -l git_Hash |
| 427 |
|
echo -n ' git_Hash: ' |
| 428 |
|
cat git_Hash |
| 429 |
|
echo "Remove file 'git_Hash' to force tomorrow 'tap' testing" |
| 430 |
|
rm -f git_Hash |
| 431 |
|
fi |
| 432 |
|
fi |