From 2a58657df50abe5e69161e68c703cd9674c87a70 Mon Sep 17 00:00:00 2001 From: Edouard DUPIN Date: Tue, 25 Nov 2014 22:07:48 +0100 Subject: [PATCH] [DEV] add gcov property --- lutin.py | 9 +++++++-- lutinModule.py | 4 +++- lutinTarget.py | 8 ++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lutin.py b/lutin.py index 60d502a..6a124c7 100755 --- a/lutin.py +++ b/lutin.py @@ -36,6 +36,7 @@ myLutinArg.add(lutinArg.ArgDefine("a", "arch", list=[["auto","Automatic choice"] myLutinArg.add(lutinArg.ArgDefine("b", "bus", list=[["auto","Automatic choice"],["32","32 bits"],["64","64 bits"]], desc="Adressing size (Bus size)")) myLutinArg.add(lutinArg.ArgDefine("r", "prj", desc="Use external project management (not build with lutin...")) myLutinArg.add(lutinArg.ArgDefine("p", "package", desc="Disable the package generation (usefull when just compile for test on linux ...)")) +myLutinArg.add(lutinArg.ArgDefine("g", "gcov", desc="Enable code coverage intrusion in code")) myLutinArg.add(lutinArg.ArgDefine("", "simulation", desc="simulater mode (availlable only for IOS)")) myLutinArg.add(lutinArg.ArgDefine("", "list-target", desc="list all availlables targets ==> for auto completion")) myLutinArg.add(lutinArg.ArgDefine("", "list-module", desc="list all availlables module ==> for auto completion")) @@ -141,7 +142,8 @@ def Start(): "arch":"auto", "generate-package":True, "simulation":False, - "extern-build":False + "extern-build":False, + "gcov":False } # load the default target : target = None @@ -154,6 +156,8 @@ def Start(): config["generate-package"]=False elif argument.get_option_nName() == "simulation": config["simulation"]=True + elif argument.get_option_nName() == "gcov": + config["gcov"]=True elif argument.get_option_nName() == "prj": config["extern-build"]=True elif argument.get_option_nName() == "bus": @@ -179,7 +183,8 @@ def Start(): "arch":"auto", "generate-package":True, "simulation":False, - "extern-build":False + "extern-build":False, + "gcov":False } #remove previous target target = None diff --git a/lutinModule.py b/lutinModule.py index 6a8e94b..eac85a0 100644 --- a/lutinModule.py +++ b/lutinModule.py @@ -471,7 +471,9 @@ class Module: or fileExt == "cxx" \ or fileExt == "CXX" \ or fileExt == "xx" \ - or fileExt == "XX": + or fileExt == "XX" \ + or fileExt == "CC" \ + or fileExt == "cc": resFile = self.compile_xx_to_o(file, packageName, target, self.subHeritageList) listSubFileNeededTobuild.append(resFile) elif fileExt == "mm" \ diff --git a/lutinTarget.py b/lutinTarget.py index 7b55ef5..3fec205 100644 --- a/lutinTarget.py +++ b/lutinTarget.py @@ -89,6 +89,14 @@ class Target: else: self.global_flags_cc.append("-DNDEBUG") self.global_flags_cc.append("-O3") + + ## To add code coverate on build result system + if self.config["gcov"] == True: + self.global_flags_cc.append("-fprofile-arcs") + self.global_flags_cc.append("-ftest-coverage") + self.global_flags_ld.append("-fprofile-arcs") + self.global_flags_ld.append("-ftest-coverage") + self.update_folder_tree() self.folder_bin="/usr/bin" self.folder_lib="/usr/lib"