Test Program Entry Point
Test RealTime - User Guide
TEST 1
FAMILY nominal
ELEMENT
VAR x , init = 1 , ev = 4
Var Y , init=4 ,ev = 1
#swap_integer(x,y) ;
END ELEMENT
END TEST
END SERVICE
Test Program Entry Point
Since ATTOL_TEST is a sub-unit and not a main unit, Component Testing for Ada
generates a main procedure at the end of the test program with the name provided
on the command line.
Two methods are available to start the execution of the test program:
·
Call during the elaboration of the unit under test.
·
Call by the main procedure.
Call During the Elaboration of the Unit
In this case, you must add an additional line in the body of the unit tested:
PACKAGE <name>
...
END;
PACKAGE BODY <name>
...
PROCEDURE ATTOL_TEST is SEPARATE;
BEGIN
...
ATTOL_TEST;
END;
The package specification is not modified, but the test procedure is called at every
elaboration of the package. Therefore, you need to remove or replace this call with an
empty procedure after the test phase.
Call by the Main Procedure
In this case, you must add an additional line in the specification of the unit tested:
PACKAGE < name>
...
PROCEDURE ATTOL_TEST;
...
END;
PACKAGE BODY <name> is
...
PROCEDURE ATTOL_TEST is SEPARATE;
END;
118