[DEV] support of gcov with french translating
This commit is contained in:
parent
6e69681480
commit
b645f087f3
@ -261,31 +261,51 @@ class Module:
|
||||
executed_lines = 0
|
||||
executable_lines = 0
|
||||
for elem in ret:
|
||||
debug.verbose("line : " + elem)
|
||||
if remove_next == True:
|
||||
remove_next = False
|
||||
continue;
|
||||
if elem[:10] == "Creating '" \
|
||||
or elem[:10] == "Removing '":
|
||||
or elem[:10] == "Removing '" \
|
||||
or elem[:14] == "Suppression de" \
|
||||
or elem[:11] == "Création de":
|
||||
remove_next = True
|
||||
continue
|
||||
if elem[:6] == "File '" \
|
||||
if elem[:6] in ["File '", "File «"] \
|
||||
or elem[:7] in ["File ' ", "File « "]:
|
||||
if self.origin_path != elem[7:len(self.origin_path)+7] \
|
||||
and self.origin_path != elem[6:len(self.origin_path)+6]:
|
||||
remove_next = True
|
||||
debug.verbose(" REMOVE: '" + str(self.origin_path) + "' != '" + str(elem[6:len(self.origin_path)+7]) + "'")
|
||||
continue
|
||||
if elem[:6] == "File '":
|
||||
if elem[:6] not in ["File '", "File «"]:
|
||||
last_file = elem[6+len(self.origin_path)+1:-1]
|
||||
if elem[:7] not in ["File ' ", "File« "]:
|
||||
last_file = elem[7+len(self.origin_path)+1:-1]
|
||||
continue
|
||||
start_with = "Lines executed:"
|
||||
if elem[:len(start_with)] != start_with:
|
||||
if elem[:7] == "Aucune ":
|
||||
debug.verbose(" Nothing to execute");
|
||||
continue
|
||||
start_with = ["Lines executed:", "Lignes exécutées:"]
|
||||
find = False
|
||||
for line_base in start_with:
|
||||
if elem[:len(line_base)] == line_base:
|
||||
find = True
|
||||
elem = elem[len(line_base)+1:]
|
||||
break;
|
||||
if find == False:
|
||||
debug.warning(" gcov ret : " + str(elem));
|
||||
debug.warning(" ==> does not start with : " + start_with);
|
||||
debug.warning(" ==> does not start with : " + str(start_with));
|
||||
debug.warning(" Parsing error");
|
||||
continue
|
||||
out = elem[len(start_with):].split("% of ")
|
||||
out = elem.split("% of ")
|
||||
if len(out) != 2:
|
||||
out = elem.split("% de ")
|
||||
if len(out) != 2:
|
||||
debug.warning(" gcov ret : " + str(elem));
|
||||
debug.warning(" Parsing error of '% of '");
|
||||
continue
|
||||
debug.verbose("property : " + str(out))
|
||||
pourcent = float(out[0])
|
||||
total_line_count = int(out[1])
|
||||
total_executed_line = int(float(total_line_count)*pourcent/100.0)
|
||||
@ -303,7 +323,10 @@ class Module:
|
||||
debug.info(" % " + str(elem[1]) + "\r\t\t" + str(elem[0]));
|
||||
else:
|
||||
debug.info(" % " + str(elem[1]) + "\r\t\t" + str(elem[0]));
|
||||
try:
|
||||
pourcent = 100.0*float(executed_lines)/float(executable_lines)
|
||||
except ZeroDivisionError:
|
||||
pourcent = 0.0
|
||||
# generate json file:
|
||||
json_file_name = target.get_build_path(self.name) + "/" + self.name + "_coverage.json"
|
||||
debug.debug("generate json file : " + json_file_name)
|
||||
|
@ -121,8 +121,8 @@ class Target:
|
||||
"-ftest-coverage"
|
||||
])
|
||||
self.add_flag("link", [
|
||||
"-fprofile-arcs",
|
||||
"-ftest-coverage"
|
||||
"-lgcov",
|
||||
"--coverage"
|
||||
])
|
||||
|
||||
self.update_path_tree()
|
||||
|
@ -126,7 +126,7 @@ def link(file, binary, target, depancy, flags, name, basic_path, static = False)
|
||||
except:
|
||||
pass
|
||||
try:
|
||||
cmd.append(target.global_flags_ld)
|
||||
cmd.append(target.global_flags["link"])
|
||||
except:
|
||||
pass
|
||||
for view in ["local", "export"]:
|
||||
|
Loading…
x
Reference in New Issue
Block a user