type Test_Type is (CONTAINER, ROUTINE);
type Context (Phase : Test_Phase) is record
Test_Name : AStrings.Bounded_String;
Test_Kind : Test_Type;
case Phase is
when TEST_BEGIN | TEST_END =>
null;
when TEST_RUN =>
Routine_Name : AStrings.Bounded_String;
Message : AStrings.Bounded_String;
Long_Message : Long_AStrings.Bounded_String;
end case;
end record;
type Result_Listener is
abstract new Ada.Finalization.Limited_Controlled with null record;
Result_Listener is a listener for test results. Whenever a test is run, the framework calls registered listeners and tells them the result of the test.
type Result_Listener_Class_Access is access all Result_Listener'Class;
procedure Add_Pass (Listener : in out Result_Listener;
Info : Context) is abstract;
Called after test passes.
procedure Add_Failure (Listener : in out Result_Listener;
Info : Context) is abstract;
Called after test fails.
procedure Add_Error (Listener : in out Result_Listener;
Info : Context) is abstract;
Called after there is an error in the test.
New in version 2.0.
procedure Add_Skipped (Listener : in out Result_Listener;
Info : Context);
Called when user wants to skip the test.
By default, skipped tests are treated as failures. Listeners should reimplement this function if they want to report skipped tests separately.
procedure Start_Test (Listener : in out Result_Listener;
Info : Context) is abstract;
Called before the test begins. This is called before Add_* procedures.
procedure End_Test (Listener : in out Result_Listener;
Info : Context) is abstract;
Called after the test ends. Add_* procedures are called before this.