~ubuntu-branches/ubuntu/raring/adacontrol/raring

« back to all changes in this revision

Viewing changes to src/adactl.adb

  • Committer: Bazaar Package Importer
  • Author(s): Ludovic Brenta
  • Date: 2010-03-13 14:01:37 UTC
  • mfrom: (1.1.5 upstream) (9.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20100313140137-50ia1bbb5qld97fd
Tags: 1.12~b1-1
New upstream beta version.  Really closes: #566061 even on i386.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
with
55
55
  Adactl_Options,
56
56
  Framework.Language,
57
 
  Framework.Reports;
 
57
  Framework.Reports,
 
58
  Framework.Rules_Manager;
58
59
 
59
60
procedure Adactl is
60
61
   use Ada.Characters.Handling, Ada.Calendar;
72
73
   use Framework.Language;
73
74
begin
74
75
   Thick_Queries.Set_Error_Procedure (Utilities.Failure'Access);
 
76
   Framework.Rules_Manager.Initialize;
75
77
 
76
78
   Analyse_Options;
77
79
 
141
143
         Ada.Command_Line.Set_Exit_Status (OK);
142
144
      end if;
143
145
 
144
 
      declare
145
 
         Exec_Time_String : constant Wide_String
146
 
           := Integer_Img (Integer ((Clock - Start_Time)*10));
147
 
      begin
148
 
         if Framework.Language.Had_Errors then
149
 
            User_Log ("Syntax errors found");
150
 
         elsif Action = Check then
151
 
            User_Log ("No syntax error");
152
 
         else
 
146
      if Framework.Language.Had_Errors then
 
147
         User_Log ("Syntax errors found");
 
148
      elsif Action = Check then
 
149
         User_Log ("No syntax error");
 
150
      else
 
151
         declare
 
152
            -- Execution time in tenth of seconds:
 
153
            Exec_Time : constant Integer := Integer ((Clock - Start_Time) * 10);
 
154
            Hours     : constant Integer := Exec_Time / (3600 * 10);
 
155
            Mins      : constant Integer := Exec_Time rem (3600 * 10) / (60 * 10);
 
156
            Secs      : constant Integer := Exec_Time rem (60 * 10) / 10;
 
157
            Tens      : constant Integer := Exec_Time rem 10;
 
158
         begin
 
159
            -- We don't output tens if > 1 min
153
160
            User_Log ("Total execution time: "
154
 
                      & Choose (Exec_Time_String (1 .. Exec_Time_String'Last - 1), "0")
155
 
                      & '.'
156
 
                      & Exec_Time_String (Exec_Time_String'Last)
157
 
                      & "s.");
158
 
         end if;
159
 
      end;
 
161
                        & Choose (Hours /= 0, Integer_Img (Hours) & "h ", "")
 
162
                        & Choose (Mins  /= 0, Integer_Img (Mins)  & "mn ", "")
 
163
                        & Integer_Img (Secs)
 
164
                        & Choose (Mins = 0, '.' & Integer_Img (Tens), "") & "s.");
 
165
         end;
 
166
      end if;
160
167
   end if;
161
168
 
162
169
exception