Natools

Check-in [423c312ac9]
Login
Overview
Comment:Add coverage analysis configuration
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 423c312ac91c5c3fd28453bb7915a2b9b805e530
User & Date: nat on 2013-09-09 18:18:36
Other Links: manifest | tags
Context
2013-09-10
17:49
natools-accumulators-tests: New black-box test suite for string accumulators check-in: 28738393c8 user: nat tags: trunk
2013-09-09
18:18
Add coverage analysis configuration check-in: 423c312ac9 user: nat tags: trunk
2013-09-08
14:30
tests.gpr: refactor flags parameters check-in: aaf4f454f0 user: nat tags: trunk
Changes

Added coverage.sh version [06b03219c6].






1
2
3
4
5
+
+
+
+
+
#!/bin/sh
gnatmake -p -Ptests -XMODE=Coverage || exit $?
coverage/bin/test_all
lcov --gcov-tool gnatgcov --directory coverage/obj --output coverage/test-info.dat --capture || exit $?
genhtml --output-dir coverage coverage/test-info.dat

Modified natools.gpr from [e3a67ce517] to [8ccc9c476c].

1













2
3
4











5
6
7
8
9
10
11
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34

+
+
+
+
+
+
+
+
+
+
+
+
+


-
+
+
+
+
+
+
+
+
+
+
+







project Natools is
   type Build_Type is ("Release", "Coverage");
   Mode : Build_Type := external ("MODE", "Release");

   Prefix := "";
   Extra_Switches := ();

   case Mode is
      when "Release" =>
         Prefix := "";
      when "Coverage" =>
         Prefix := "coverage/";
   end case;

   --  Source_Dirs is left to default "."
   for Source_Dirs use ("src");
   for Object_Dir use "obj";
   for Object_Dir use Prefix & "obj";
   for Exec_Dir use Prefix & "bin";

   case Mode is
      when "Release" =>
         Extra_Switches := ("-O3");
      when "Coverage" =>
         Extra_Switches :=
           ("-g", "-O0", "-fprofile-arcs", "-ftest-coverage");
   end case;


   package Compiler is
      for Default_Switches ("Ada") use
        ("-gnatafnovy",
            --  a: assersions enabled
            --  f: full errors (verbose details and all undefined references)
            --  n: enable pragma Inline
29
30
31
32
33
34
35
36

37

38
39
40
41

42
43
52
53
54
55
56
57
58

59

60
61
62
63

64
65
66







-
+
-
+



-
+


            --     s: presence of subprogram specs
            --     t: token separation rules
         "-gnateE",
            --  generate extra information in exception messages
         "-gnatwae",
            --  a: turn on most warnings
            --  e: treat all warnings as errors
         "-fstack-check",
         "-fstack-check")
         "-O3");
        & Extra_Switches;
   end Compiler;

   package Linker is
      for Default_Switches ("Ada") use ("-O3");
      for Default_Switches ("Ada") use Extra_Switches;
   end Linker;
end Natools;