Commit 0472e0f3 authored by yoogx's avatar yoogx
Browse files

* Add support for GNATcheck

        For issue openaadl/ocarina#137
parent 46077078
...@@ -101,6 +101,12 @@ $(BUILD_STAMPS): %-build: ...@@ -101,6 +101,12 @@ $(BUILD_STAMPS): %-build:
-XABS_BUILD_DIR="$(PL_DEP_ABS_BUILD_DIR)" \ -XABS_BUILD_DIR="$(PL_DEP_ABS_BUILD_DIR)" \
$(AP_FLAGS); $(AP_FLAGS);
gnatcheck: %-build:
ADA_PROJECT_PATH=$(top_srcdir)/projects:$(ADA_PROJECT_PATH) \
gnat check -Pocarina-main.gpr -U $(GNATFLAGS) \
-XABS_SRC_DIR="$(PL_DEP_ABS_SRC_DIR)" \
-XABS_BUILD_DIR="$(PL_DEP_ABS_BUILD_DIR)"
clean-local: $(BUILD_DIRS) $(CLEAN_STAMPS) clean-mknodes clean-local: $(BUILD_DIRS) $(CLEAN_STAMPS) clean-mknodes
# XXX creating/deleting ocarina-configuration.adb is to please # XXX creating/deleting ocarina-configuration.adb is to please
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- P r o j e c t -- -- P r o j e c t --
-- -- -- --
-- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. -- -- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2018 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify under -- -- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -50,10 +50,12 @@ project Ocarina.Main is ...@@ -50,10 +50,12 @@ project Ocarina.Main is
package Compiler renames Ocarina.Compiler; package Compiler renames Ocarina.Compiler;
package Binder renames Ocarina.Binder; package Binder renames Ocarina.Binder;
package Linker renames Ocarina.Linker; package Linker renames Ocarina.Linker;
package Check renames Ocarina.Check;
package Builder is package Builder is
for Executable ("ocarina_cmd.adb") use "ocarina"; for Executable ("ocarina_cmd.adb") use "ocarina";
for Default_Switches ("Ada") use for Default_Switches ("Ada") use
Ocarina.Builder'Default_Switches ("Ada"); Ocarina.Builder'Default_Switches ("Ada");
end Builder; end Builder;
end Ocarina.Main; end Ocarina.Main;
...@@ -6,9 +6,7 @@ ...@@ -6,9 +6,7 @@
-- -- -- --
-- P r o j e c t -- -- P r o j e c t --
-- -- -- --
-- Copyright (C) 2009-2012, European Space Agency (ESA). -- -- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2018 ESA & ISAE. --
-- --
-- Copyright (C) 2007-2009 Telecom ParisTech, 2010-2015 ESA & ISAE. --
-- -- -- --
-- Ocarina is free software; you can redistribute it and/or modify under -- -- Ocarina is free software; you can redistribute it and/or modify under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -26,8 +24,8 @@ ...@@ -26,8 +24,8 @@
-- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see -- -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
-- <http://www.gnu.org/licenses/>. -- -- <http://www.gnu.org/licenses/>. --
-- -- -- --
-- Ocarina is maintained by the Ocarina team -- -- Ocarina is maintained by the TASTE project --
-- (ocarina-users@listes.enst.fr) -- -- (taste-users@lists.tuxfamily.org) --
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
...@@ -59,19 +57,19 @@ project Ocarina is ...@@ -59,19 +57,19 @@ project Ocarina is
"-fstack-check", "-fstack-check",
"-gnaty", "-gnaty",
"-gnatwL", -- elaboration warnings disabled "-gnatwL", -- elaboration warnings disabled
"-gnatyu", -- not in -gnaty: check multiple blank lines "-gnatyu", -- not in -gnaty: check multiple blank lines
"-gnatys", -- not in -gnatx: check useless parentheses "-gnatys", -- not in -gnatx: check useless parentheses
@GCOV@"-fprofile-arcs", @GCOV@"-fprofile-arcs",
@GCOV@"-ftest-coverage", @GCOV@"-ftest-coverage",
"-gnat12"); "-gnat12");
when "release" => when "release" =>
for Default_Switches ("Ada") use for Default_Switches ("Ada") use
("-O2", ("-O2",
"-gnat12", "-gnat12",
"-gnata", "-gnata",
"-gnaty", "-gnaty",
"-gnatyu", -- not in -gnaty: check multiple blank lines "-gnatyu", -- not in -gnaty: check multiple blank lines
"-gnatys", -- not in -gnatx: check useless parentheses "-gnatys", -- not in -gnatx: check useless parentheses
"-gnatpn"); "-gnatpn");
end case; end case;
end Compiler; end Compiler;
...@@ -79,7 +77,11 @@ project Ocarina is ...@@ -79,7 +77,11 @@ project Ocarina is
package Binder is package Binder is
case Build is case Build is
when "debug" => when "debug" =>
for Default_Switches ("Ada") use ("-E", "-t"); for Default_Switches ("Ada") use
("-E", -- Store traceback information in exception occurences
"-r", -- List additional restrictions
"-t" -- Tolerate timestamps and other consistency errors
);
when "release" => when "release" =>
for Default_Switches ("Ada") use ("-t", "-static"); for Default_Switches ("Ada") use ("-t", "-static");
end case; end case;
...@@ -89,9 +91,9 @@ project Ocarina is ...@@ -89,9 +91,9 @@ project Ocarina is
case Build is case Build is
when "debug" => when "debug" =>
for Default_Switches ("Ada") use ( for Default_Switches ("Ada") use (
@GCOV@"-g", @GCOV@"-g",
@GCOV@"-fprofile-arcs", @GCOV@"-fprofile-arcs",
@GCOV@"-ftest-coverage" @GCOV@"-ftest-coverage"
); );
when "release" => when "release" =>
for Default_Switches ("Ada") use (); for Default_Switches ("Ada") use ();
...@@ -106,4 +108,18 @@ project Ocarina is ...@@ -106,4 +108,18 @@ project Ocarina is
for Default_Switches ("Ada") use ("-s"); for Default_Switches ("Ada") use ("-s");
end case; end case;
end Builder; end Builder;
-----------
-- Check --
-----------
package Check is
for Default_Switches ("ada") use
("-rules",
"+RGoto", -- 9.1.5.11 Goto Statements
"+RMetrics_Cyclomatic_Complexity:7",
"+RMetrics_LSLOC:150"
);
end Check;
end Ocarina; end Ocarina;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment