CodeTools[Profiling][Coverage] - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Profiling : CodeTools[Profiling] : Coverage : CodeTools/Profiling/Coverage/Print

CodeTools[Profiling][Coverage]

  

Print

  

print coverage information for procedures

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

Print(proc1, proc2, ..., tab1, tab2, opts)

Parameters

proc1, proc2, ...

-

(optional) procedure

tab1, tab2, ...

-

(optional) table of profiling data

opts

-

(optional) equation of the form 'option'=value where option is one of depth, format, or output; specify options for the Print command

Description

• 

The Print() command prints the coverage information for the procedures for which it has profiling data.

  

The coverage information indicates which statements were covered and which were not.

• 

The Print(proc1, proc2, ...) command prints the coverage information for the specified procedures, proc1, proc2, ... .

• 

Print reads profiling information from currently profiled procedures and from any tables of profiling data passed.  If a procedure appears more than once in any of these sources, the profiles are joined together (as in Merge) and the data from the merged profiles prints.

• 

The optional argument 'output' = 'string' indicates that Print return a string instead of printing to the screen.  The default is 'output'='print'.

• 

The option format can be any of the following names that specify the amount of information that is printed.

  

 

  

'compact'

  

Specifies that the name of the function, the total number of times the procedure was executed (in parenthesis), and the statement numbers of those lines that were not covered is printed.  For procedures which were completely covered, nothing is printed.

  

 

  

'normal'

  

Specifies that the name of the function, the total number of times the procedure was executed (in parenthesis), and the statements that were not covered is printed. This is the default print level.  For procedures which were completely covered, a single line which states this is printed.

  

 

  

'long'

  

Specifies that every statement of every procedure annotated with the number of times that statement was executed is printed.

  

 

• 

A statement is considered covered if it is executed greater than or equal to a certain number of times.  Use the 'depth' argument to specify the number of iterations required.

  

 

  

'depth'=posint

  

Specifies the number of times that a statement has to be executed to be considered covered.  The default is one.

  

 

Examples

a := proc(x)
    local y;
    if (x > 1) then
        y := int(i^x, i);
        return y;
    else
        y := int(sin(i), i);
        return y;
    end if;
end proc:

withCodeTools[Profiling]:

t1Buildprocs='a',commands='a2':

Coverage[Print]a,t1,'format'='long'

a (1):
 local y;
    1   if 1 < x then
    1     y := int(i^x,i);
    1     return y
        else
    0     y := int(sin(i),i);
    0     return y
        end if
 end proc
 

Coverage&lsqb;Print&rsqb;a&comma;t1

a (1):
    4     y := int(sin(i),i);
    5     return y

Coverage&lsqb;Print&rsqb;a&comma;t1&comma;&apos;format&apos;&equals;&apos;compact&apos;

a (1): 4 5

t2Buildprocs&equals;&apos;a&apos;&comma;commands&equals;&apos;a0&apos;&colon;

Coverage&lsqb;Print&rsqb;a&comma;t1&comma;t2&comma;&apos;format&apos;&equals;&apos;long&apos;

a (2):
 local y;
    2   if 1 < x then
    1     y := int(i^x,i);
    1     return y
        else
    1     y := int(sin(i),i);
    1     return y
        end if
 end proc
 

Coverage&lsqb;Print&rsqb;a&comma;t1&comma;t2

a (2): all statements covered

Coverage&lsqb;Print&rsqb;a&comma;t1&comma;t2&comma;&apos;format&apos;&equals;&apos;compact&apos;

t3Buildprocs&equals;&apos;a&apos;&comma;commands&equals;&apos;a0&apos;&colon;

Coverage&lsqb;Print&rsqb;a&comma;t1&comma;t2&comma;t3&comma;&apos;format&apos;&equals;&apos;long&apos;&comma;&apos;depth&apos;&equals;2

a (3):
 local y;
    3   if 1 < x then
    1     y := int(i^x,i);
    1     return y
        else
    2     y := int(sin(i),i);
    2     return y
        end if
 end proc
 

Coverage&lsqb;Print&rsqb;a&comma;t1&comma;t2&comma;t3&comma;&apos;depth&apos;&equals;2

a (3):
    2     y := int(i^x,i);
    3     return y

Coverage&lsqb;Print&rsqb;a&comma;t1&comma;t2&comma;t3&comma;&apos;format&apos;&equals;&apos;compact&apos;&comma;&apos;depth&apos;&equals;2

a (3): 2 3

See Also

CodeTools[Profiling]

CodeTools[Profiling][Build]

CodeTools[Profiling][Coverage]

CodeTools[Profiling][GetProfileTable]

CodeTools[Profiling][Merge]

CodeTools[Profiling][Profile]

CodeTools[Profiling][UnProfile]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam