test/jdk/sun/tools/jstat/compilerOutput1.awk
changeset 47216 71c04702a3d5
parent 22562 e909d64b8dd8
equal deleted inserted replaced
47215:4ebc2e2fb97c 47216:71c04702a3d5
       
     1 #
       
     2 # matching the following output specified as a pattern that verifies
       
     3 # that the numerical values conform to a specific pattern, rather than
       
     4 # specific values.
       
     5 #
       
     6 # Compiled Failed Invalid   Time   FailedType FailedMethod
       
     7 #       38      0       0     0.41          0             
       
     8 
       
     9 
       
    10 
       
    11 BEGIN	{
       
    12 	    headerlines=0; datalines=0; totallines=0
       
    13 	}
       
    14 
       
    15 /^Compiled Failed Invalid   Time   FailedType FailedMethod$/	{
       
    16 	    headerlines++;
       
    17 	}
       
    18 
       
    19 # note - the FailedMethod column is not matched very thoroughly by the
       
    20 # following pattern. We just check for zero or more spaces after the
       
    21 # FailedType column and the for any sequence of characters for the
       
    22 # FailedMethod column. Better checking would verify an optional string of
       
    23 # characters that follows class/method name patterns. However, it's very
       
    24 # difficult to generate any data in this column under normal circumstances.
       
    25 #
       
    26 /^[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+[ ]*[0-9]+\.[0-9]+[ ]*[0-9]+[ ]*.*$/	{
       
    27 	    datalines++;
       
    28 	}
       
    29 
       
    30 	{ totallines++; print $0 }
       
    31 
       
    32 END	{
       
    33 	    if ((headerlines == 1) && (datalines == 1)) {
       
    34 	        exit 0
       
    35 	    }
       
    36 	    else {
       
    37 	        exit 1
       
    38 	    }
       
    39 	}