#!/usr/bin/awk -f # vres2 - calculate total, pass and fail only, suitable for input to cut # typically used as # TOTAL=`vres2 $journal|sed 1q|cut -f2 -d":"` # derived from: # vres - calculate summary reports - version for vsx4 # # Copyright 1996-2006 The Open Group (TOG) # Copyright 1991 UNIX System Laboratories Europe, Ltd (USLE) # # Permission to use, copy, modify, and distribute this software # for any purpose and without fee is hereby granted, provided # that the above copyright notice appear in all copies and that both that # copyright notice and this permission notice appear in supporting # documentation, and that the name of USLE and TOG not be used in # advertising or publicity pertaining to distribution of the software # without specific, written prior permission. USLE and TOG make # no representations about the suitability of this software for any purpose. # It is provided "as is" without express or implied warranty. # # USLE and TOG DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, # INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO # EVENT SHALL USLE BE LIABLE FOR ANY SPECIAL, INDIRECT OR # CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF # USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR # OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR # PERFORMANCE OF THIS SOFTWARE. # BEGIN {} $1 ~ "^220" {if ($3 == 0) passed++ else if ($3 == 1) failed++ else if ($3 == 2) unresolved++ else if ($3 == 3) notinuse++ else if ($3 == 4) unsuported++ else if ($3 == 5) untested++ else if ($3 == 6) uninitiated++ else if ($3 == 7) unreported++ else if ($3 == 101) warning++ else if ($3 == 102) fip++ else if ($3 == 103) notimp++ else if ($3 == 104) unapprove++ else {printf("Unknown result code: %d\n",$3);unknown++} total++ } $1 ~ "^50" { tetfail++ } $1 ~ "^510" { tetwarn++} END { pass=passed+warning+fip+unsuported+notinuse+untested+unapprove+notimp; fail=failed+unresolved+uninitiated+unreported; printf("Total:%d:PASS:%d:FAIL:%d\n",total,pass,fail); if (unknown > 0) printf("*WARNING #1* unknown result code encountered\n"); if (tetfail > 0) printf("*WARNING #2* TET failure result code encountered\n"); }