3305ca171bc112d398038dcf3f08466abd61b897
steve
  Mon Nov 26 12:31:16 2012 -0800
Added an error counter and a summary line in the output so in the event of no errors, there wouldn't just be a blank output file
diff --git src/utils/qa/checkTrackUiLinks.csh src/utils/qa/checkTrackUiLinks.csh
index 2b3eb0a..37791f4 100755
--- src/utils/qa/checkTrackUiLinks.csh
+++ src/utils/qa/checkTrackUiLinks.csh
@@ -6,30 +6,31 @@
 #  01-24-07
 #  Robert Kuhn
 #
 #  checks all links on trackUi pages for a track
 #
 ################################
 
 set tableinput=""
 set tables=""
 set machine="hgwbeta"
 set rr="false"
 set baseUrl=""
 set target=""
 set hgsid=""
 set db=""
+set errorCount=0
 
 if ( $#argv < 2 || $#argv > 3 ) then
   echo
   echo "  checks all links on trackUi pages for a track."
   echo
   echo "    usage:  database tablelist [machine]"
   echo '           tablelist may also be single table or "all"'
   echo "           machine defaults to hgwbeta"
   echo
   echo '    note: includes assembly description.html page if "all"'
   echo
   exit
 else
   set db=$argv[1]
   set tableinput=$argv[2]
@@ -80,41 +81,55 @@
   set rr="true"
 endif
 
 # process "all" choice
 if ("all" == $tableinput) then
   set tables=`getField.csh $db trackDb tableName $machine \
      | grep -v tableName`
   set target="$baseUrl/cgi-bin/hgGateway?hgsid=$hgsid&db=$db"
   # check description page if doing all of an assembly
   htmlCheck checkLinks "$target" >& error
   if ( `wc -w error | awk '{print $1}'` != 0 ) then
     echo
     echo "description.html page:"
     echo "======================"
     cat error
+    @ errorCount = $errorCount + 1
     rm -f error
   endif
 endif
 
 foreach table ($tables)
   # check to see if the table exists on the machine
   getField.csh $db trackDb tableName $machine | grep -w $table > /dev/null
   if ( $status ) then
     echo "no such track"
     continue
   endif
   set target="$baseUrl/cgi-bin/hgTrackUi?hgsid=$hgsid&db=$db&g=$table"
   htmlCheck checkLinks "$target" >& error
   # slow it down if hitting the RR
   if ( "true" == $rr ) then
     sleep 2
   endif
   if ( `wc -w error | awk '{print $1}'` != 0 ) then
     echo
     echo $table
     echo "============="
     cat error
+    @ errorCount = $errorCount + 1
     rm -f error
   endif
 end
 echo
+echo "Summary"
+echo "======="
+if ( $errorCount > 0) then
+  if ( $errorCount == 1) then
+    echo $errorCount "error found"
+  else
+    echo $errorCount "errors found"
+  endif
+else
+  echo "No errors found!"
+endif
+echo