+2012-11-06 Robert Dewar <dewar@adacore.com>
+
+ * exp_prag.adb, impunit.adb, exp_ch9.adb, par-ch4.adb,
+ s-tarest.adb: Minor reformatting.
+
+2012-11-06 Tristan Gingold <gingold@adacore.com>
+
+ * s-tposen.ads: Minor comment update.
+
+2012-11-06 Arnaud Charlet <charlet@adacore.com>
+
+ * sysdep.c: Rename sig* wrappers to use unique names.
+
+2012-11-06 Yannick Moy <moy@adacore.com>
+
+ * exp_dbug.adb (Qualify_Entity_Name): Mark entity as having a qualified
+ name after being treated, in formal verification mode.
+
+2012-11-06 Fedor Rybin <frybin@adacore.com>
+
+ * gnat_ugn.texi: Updating gnattest section to reflect changes
+ in default behaviour of the tool.
+
2012-11-06 Thomas Quinot <quinot@adacore.com>
* s-oscons-tmplt.c: Interfaces.C now needs to be WITH'd even
declare
Create_RE : RE_Id;
+
begin
if Restricted_Profile then
if Partition_Elaboration_Policy = 'S' then
else
Create_RE := RE_Create_Task;
end if;
+
Name := New_Reference_To (RTE (Create_RE), Loc);
end;
if Has_Qualified_Name (Ent) then
return;
- -- In formal verification mode, simply append a suffix for homonyms, but
- -- do not mark the name as being qualified. We used to qualify entity
- -- names as full expansion does, but this was removed as this prevents
- -- the verification back-end from using a short name for debugging and
- -- user interaction. The verification back-end already takes care of
- -- qualifying names when needed.
+ -- In formal verification mode, simply append a suffix for homonyms.
+ -- We used to qualify entity names as full expansion does, but this was
+ -- removed as this prevents the verification back-end from using a short
+ -- name for debugging and user interaction. The verification back-end
+ -- already takes care of qualifying names when needed. Still mark the
+ -- name as being qualified, as Qualify_Entity_Name may be called more
+ -- than once on the same entity.
elsif Alfa_Mode then
if Has_Homonym (Ent) then
Set_Chars (Ent, Name_Enter);
end if;
+ Set_Has_Qualified_Name (Ent);
return;
-- If the entity is a variable encoding the debug name for an object
-- Old_1 : <type of Incr_Expr>;
-- Old_2 : <type of Decr_Expr>;
-- Flag : Boolean := False;
- --
+
-- for | while ... loop
-- <preceding source statements>
- --
+
-- pragma Assert (<Invar_Expr>);
- --
+
-- if Flag then
-- Old_1 := Curr_1;
-- Old_2 := Curr_2;
-- end if;
- --
+
-- Curr_1 := <Incr_Expr>;
-- Curr_2 := <Decr_Expr>;
- --
+
-- if Flag then
-- if Curr_1 /= Old_1 then
-- pragma Assert (Curr_1 > Old_1);
-- else
-- Flag := True;
-- end if;
- --
+
-- <succeeding source statements>
-- end loop;
Make_Op_Gt (Loc,
Left_Opnd => Curr_Val,
Right_Opnd => Old_Val);
- else
+
+ else pragma Assert (Chars (Arg) = Name_Decreases);
return
Make_Op_Lt (Loc,
Left_Opnd => Curr_Val,
Object_Definition =>
New_Reference_To (Etype (Expr), Loop_Loc)));
- -- Restore the original scope after all temporaries have been
- -- analyzed.
+ -- Restore original scope after all temporaries have been analyzed
Pop_Scope;
- -- Step 3: Store the value of the expression from the previous
- -- iteration.
+ -- Step 3: Store value of the expression from the previous iteration
if No (Old_Assign) then
Old_Assign := New_List;
Name => New_Reference_To (Curr_Id, Loc),
Expression => Relocate_Node (Expr)));
- -- Step 5: Create the corresponding assertion to verify the change of
- -- value.
+ -- Step 5: Create corresponding assertion to verify change of value
-- Generate:
-- pragma Assert (Curr <|> Old);
Expression => New_Reference_To (Standard_True, Loc)))));
end if;
+ -- Need a comment on this final rewrite ???
+
Rewrite (N, Make_Null_Statement (Loc));
Analyze (N);
end Expand_Pragma_Loop_Assertion;
for the test driver. If the @var{dirname} is a relative path, it is considered
relative to the object directory of the project file.
+@item --separates
+@cindex @option{--separates} (@command{gnattest})
+Bodies of all test routines are generated as separates. This option is
+temporarily provided for compatibility to support the old way of generating test
+skeletons. Its usage is not recommended because at some point the option will be
+abandoned together with this way of generating test packages.
+
+
+@item --transition
+@cindex @option{--transition} (@command{gnattest})
+This allows transition from separate test routines to monolith test packages.
+All matching test routines are overwritten with contents of corresponding
+separates. Note that if separate test routines had any manually added with
+clauses they will be moved to the test package body as is and have to be moved
+by hand.
+
@end table
@option{--tests_root}, @option{--subdir} and @option{--tests-dir} switches are
For each package containing visible subprograms, a child test package is
generated. It contains one test routine per tested subprogram. Each
declaration of a test subprogram has a comment specifying which tested
-subprogram it corresponds to. All of the test routines have separate bodies.
-The test routine located at simple-test_data-tests-test_inc_5eaee3.adb contains
+subprogram it corresponds to. Bodies of test routines are placed in test package
+bodies and are surrounded by special comment sections. Those comment sections
+should not be removed or modified in order for gnattest to be able to regenerate
+test packages and keep already written tests in place.
+The test routine Test_Inc_5eaee3 located at simple-test_data-tests.adb contains
a single statement: a call to procedure Assert. It has two arguments:
the Boolean expression we want to check and the diagnosis message to display if
the condition is false.
Bodies of test routines and test_data packages are never overridden after they
have been created once. As long as the name of the subprogram, full expanded Ada
-names, and the order of its parameters is the same, the old test routine will
-fit in its place and no test skeleton will be generated for the subprogram.
+names, and the order of its parameters is the same, and comment sections are
+intact the old test routine will fit in its place and no test skeleton will be
+generated for the subprogram.
This can be demonstrated with the previous example. By uncommenting declaration
and body of function Dec in simple.ads and simple.adb, running
skeleton is created for function Dec.
The only way of regenerating tests skeletons is to remove the previously created
-tests.
+tests together with corresponding comment sections.
@node Default Test Behavior
@section Default Test Behavior
of the type which have overriding primitives:
@smallexample
-gnattest --harness-dir=driver --liskov -Ptagged_rec.gpr
+gnattest --harness-dir=driver --validate-type-extensions -Ptagged_rec.gpr
cd driver
gprbuild -Ptest_driver
test_runner
return Not_Predefined_Unit;
end if;
- -- Not predefined if file name does not end in .ads or .adb. This can
- -- happen when non-standard file names are being used. Calling this
- -- function on a .adb file is used in GNATprove to detect when a
- -- construct comes from an instance of a generic defined in a predefined
- -- unit.
+ -- To be considered predefined, the file name must end in .ads or .adb.
+ -- File names with other extensions (coming from the use of non-standard
+ -- file naming schemes) can never be predefined.
+
+ -- Note that in the context of a compiler, the .adb case will never
+ -- arise. However it can arise for other tools, e.g. gnatprove uses
+ -- this routine to detect when a construct comes from an instance of
+ -- a generic defined in a predefined unit.
if Name_Buffer (Name_Len - 3 .. Name_Len) /= ".ads"
and then
-- Error recovery: can raise Error_Resync
function P_Primary return Node_Id is
- Lparen : constant Boolean := Prev_Token = Tok_Left_Paren;
-
Scan_State : Saved_Scan_State;
Node1 : Node_Id;
+ Lparen : constant Boolean := Prev_Token = Tok_Left_Paren;
+ -- Remember if previous token is a left parenthesis. This is used to
+ -- deal with checking whether IF/CASE/FOR expressions appearing as
+ -- primaries require extra parenthesization.
+
begin
-- The loop runs more than once only if misplaced pragmas are found
-- or if a misplaced unary minus is skipped.
-- For [all | some] indicates a quantified expression
when Tok_For =>
-
if Token_Is_At_Start_Of_Line then
Error_Msg_AP ("misplaced loop");
return Error;
return Node1;
- else
-
-- Otherwise treat as misused identifier
+ else
return P_Identifier;
end if;
Elaborated : Access_Boolean;
Chain : in out Activation_Chain;
Task_Image : String;
- Created_Task : Task_Id) is
+ Created_Task : Task_Id)
+ is
begin
- Create_Restricted_Task (Priority, Stack_Address, Size, Task_Info,
- CPU, State, Discriminants, Elaborated,
- Task_Image, Created_Task);
+ Create_Restricted_Task
+ (Priority, Stack_Address, Size, Task_Info, CPU, State,
+ Discriminants, Elaborated, Task_Image, Created_Task);
-- Append this task to the activation chain
-- procedure _clean is
-- begin
-- service_entry (_object._object'unchecked_access);
- -- unlock_entry (_object._object'unchecked_access);
-- return;
-- end _clean;
-- begin
/* Provide extern symbols for sig* as needed by the tasking run-time, instead
of static inline functions. */
-#define sigismember android_sigismember
-#define sigaddset android_sigaddset
-#define sigdelset android_sigdelset
-#define sigemptyset android_sigemptyset
-#define sigfillset android_sigfillset
-
#include <signal.h>
-#undef sigismember
-#undef sigaddset
-#undef sigdelset
-#undef sigemptyset
-#undef sigfillset
-
int
-sigismember (sigset_t *set, int signum)
+_sigismember (sigset_t *set, int signum)
{
- return android_sigismember (set, signum);
+ return sigismember (set, signum);
}
int
-sigaddset (sigset_t *set, int signum)
+_sigaddset (sigset_t *set, int signum)
{
- return android_sigaddset (set, signum);
+ return sigaddset (set, signum);
}
int
-sigdelset (sigset_t *set, int signum)
+_sigdelset (sigset_t *set, int signum)
{
- return android_sigdelset (set, signum);
+ return sigdelset (set, signum);
}
int
-sigemptyset (sigset_t *set)
+_sigemptyset (sigset_t *set)
{
- return android_sigemptyset (set);
+ return sigemptyset (set);
}
int
-sigfillset(sigset_t *set)
+_sigfillset(sigset_t *set)
{
- return android_sigfillset (set);
+ return sigfillset (set);
}
#endif