Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | tests: add Generic_Check helper procedure | 
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk | 
| Files: | files | file ages | folders | 
| SHA1: | 
8608b411316f9a51bf4ffd29a54d0a2f | 
| User & Date: | nat 2014-08-13 20:27:13.973 | 
Context
| 
   2014-08-14 
 | ||
| 17:11 | cron-tests: use the new Generic_Check tool check-in: 7daa408712 user: nat tags: trunk | |
| 
   2014-08-13 
 | ||
| 20:27 | tests: add Generic_Check helper procedure check-in: 8608b41131 user: nat tags: trunk | |
| 
   2014-08-12 
 | ||
| 21:06 | s_expressions-atom_buffers: make Atom_Buffer type limited, since copying such objects would cause complex and useless consequences check-in: 190e69b741 user: nat tags: trunk | |
Changes
Changes to src/natools-tests.adb.
| ︙ | |||
128 129 130 131 132 133 134 135  | 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158  | + + + + + + + + + + + + + + + + + + + + + + +  | 
         while Info_Lists.Has_Element (Cursor) loop
            Object.Report.Info (Info_Lists.Element (Cursor));
            Info_Lists.Next (Cursor);
         end loop;
      end if;
   end Finalize;
   procedure Generic_Check
     (Object : in out Test;
      Expected : in Result;
      Found : in Result;
      Label : in String := "") is
   begin
      if Expected /= Found then
         if Multiline then
            Fail (Object, Label);
            Info (Object, "Expected: " & Image (Expected));
            Info (Object, "Found:    " & Image (Found));
         elsif Label /= "" then
            Fail (Object, Label
              & ": expected " & Image (Expected)
              & ", found " & Image (Found));
         else
            Fail (Object, "Expected " & Image (Expected)
              & ", found " & Image (Found));
         end if;
      end if;
   end Generic_Check;
end Natools.Tests;
 | 
Changes to src/natools-tests.ads.
| ︙ | |||
116 117 118 119 120 121 122 123 124 125 126 127 128 129  | 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140  | + + + + + + + + + + +  | 
      --  Append information about Ex to the test and set its result state
   procedure Fail (Object : in out Test; Text : in String := "");
   procedure Error (Object : in out Test; Text : in String := "");
   procedure Skip (Object : in out Test; Text : in String := "");
      --  Set the result state and append Text info in a single call
   generic
      type Result (<>) is limited private;
      with function "=" (Left, Right : Result) return Boolean is <>;
      with function Image (Object : Result) return String is <>;
      Multiline : Boolean := True;
   procedure Generic_Check
     (Object : in out Test;
      Expected : in Result;
      Found : in Result;
      Label : in String := "");
private
   package Info_Lists is new Ada.Containers.Indefinite_Doubly_Linked_Lists
     (String);
   type Test (Report : access Reporter'Class) is
     new Ada.Finalization.Limited_Controlled with record
 | 
| ︙ |