with Log;
with Profile;  
with Batch_Benchmark;
with String_Utilities;
with Incremental_Benchmark;
procedure Run_Benchmarks
             (Context : in String := ">> LIBRARY CONTAINING SOURCE <<";
              Main_Unit : in String := ">> MAIN PROGRAM SPEC <<";
              Type_Unit : in String := ">> LOW-LEVEL PACKAGE SPEC <<";
              Response : in String := "<PROFILE>") is
    --
    Old_Response_Profile : Profile.Response_Profile := Profile.Get;
    New_Response_Profile : Profile.Response_Profile := Profile.Value (Response);
    --
    Context_Name : constant String := String_Utilities.Upper_Case (Context);
    Main_Unit_Name : constant String := String_Utilities.Upper_Case (Main_Unit);
    Type_Unit_Name : constant String := String_Utilities.Upper_Case (Type_Unit);
    --
begin
    --
    Profile.Set (New_Response_Profile);
    Log.Put_Line ("[Run_Benchmarks (Context => """ &
                  Context_Name & """, Main_Unit => """ &
                  Main_Unit_Name & """, Type_Unit => """ &
                  Type_Unit_Name & """, Response => """ &
                  Profile.Image (New_Response_Profile) & """);]",
                  Profile.Auxiliary_Msg);
    --
    Batch_Benchmark (Context => Context_Name,
                     Main_Unit => Main_Unit_Name,
                     Response => Response);
    --
    Incremental_Benchmark (Context => Context_Name,
                           Main_Unit => Main_Unit_Name,
                           Type_Unit => Type_Unit_Name,
                           Response => Response);
    --
    Log.Put_Line ("[end of Run_Benchmarks command - no error(s) detected]",
                  Profile.Auxiliary_Msg);
    Profile.Set (Old_Response_Profile);
    --
exception
    when others =>
        Log.Put_Line ("[end of Run_Benchmarks command - error(s) detected]",
                      Profile.Auxiliary_Msg);
        Profile.Set (Old_Response_Profile);
        --
end Run_Benchmarks;