[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
|
executed_lines = 0
|
||||||
executable_lines = 0
|
executable_lines = 0
|
||||||
for elem in ret:
|
for elem in ret:
|
||||||
|
debug.verbose("line : " + elem)
|
||||||
if remove_next == True:
|
if remove_next == True:
|
||||||
remove_next = False
|
remove_next = False
|
||||||
continue;
|
continue;
|
||||||
if elem[:10] == "Creating '" \
|
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
|
remove_next = True
|
||||||
continue
|
continue
|
||||||
if elem[:6] == "File '" \
|
if elem[:6] in ["File '", "File «"] \
|
||||||
and self.origin_path != elem[6:len(self.origin_path)+6]:
|
or elem[:7] in ["File ' ", "File « "]:
|
||||||
remove_next = True
|
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] 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
|
continue
|
||||||
if elem[:6] == "File '":
|
if elem[:7] == "Aucune ":
|
||||||
last_file = elem[6+len(self.origin_path)+1:-1]
|
debug.verbose(" Nothing to execute");
|
||||||
continue
|
continue
|
||||||
start_with = "Lines executed:"
|
start_with = ["Lines executed:", "Lignes exécutées:"]
|
||||||
if elem[:len(start_with)] != start_with:
|
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(" 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");
|
debug.warning(" Parsing error");
|
||||||
continue
|
continue
|
||||||
out = elem[len(start_with):].split("% of ")
|
out = elem.split("% of ")
|
||||||
if len(out) != 2:
|
if len(out) != 2:
|
||||||
debug.warning(" gcov ret : " + str(elem));
|
out = elem.split("% de ")
|
||||||
debug.warning(" Parsing error of '% of '");
|
if len(out) != 2:
|
||||||
continue
|
debug.warning(" gcov ret : " + str(elem));
|
||||||
|
debug.warning(" Parsing error of '% of '");
|
||||||
|
continue
|
||||||
|
debug.verbose("property : " + str(out))
|
||||||
pourcent = float(out[0])
|
pourcent = float(out[0])
|
||||||
total_line_count = int(out[1])
|
total_line_count = int(out[1])
|
||||||
total_executed_line = int(float(total_line_count)*pourcent/100.0)
|
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]));
|
debug.info(" % " + str(elem[1]) + "\r\t\t" + str(elem[0]));
|
||||||
else:
|
else:
|
||||||
debug.info(" % " + str(elem[1]) + "\r\t\t" + str(elem[0]));
|
debug.info(" % " + str(elem[1]) + "\r\t\t" + str(elem[0]));
|
||||||
pourcent = 100.0*float(executed_lines)/float(executable_lines)
|
try:
|
||||||
|
pourcent = 100.0*float(executed_lines)/float(executable_lines)
|
||||||
|
except ZeroDivisionError:
|
||||||
|
pourcent = 0.0
|
||||||
# generate json file:
|
# generate json file:
|
||||||
json_file_name = target.get_build_path(self.name) + "/" + self.name + "_coverage.json"
|
json_file_name = target.get_build_path(self.name) + "/" + self.name + "_coverage.json"
|
||||||
debug.debug("generate json file : " + json_file_name)
|
debug.debug("generate json file : " + json_file_name)
|
||||||
|
@ -121,8 +121,8 @@ class Target:
|
|||||||
"-ftest-coverage"
|
"-ftest-coverage"
|
||||||
])
|
])
|
||||||
self.add_flag("link", [
|
self.add_flag("link", [
|
||||||
"-fprofile-arcs",
|
"-lgcov",
|
||||||
"-ftest-coverage"
|
"--coverage"
|
||||||
])
|
])
|
||||||
|
|
||||||
self.update_path_tree()
|
self.update_path_tree()
|
||||||
|
@ -126,7 +126,7 @@ def link(file, binary, target, depancy, flags, name, basic_path, static = False)
|
|||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
try:
|
try:
|
||||||
cmd.append(target.global_flags_ld)
|
cmd.append(target.global_flags["link"])
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
for view in ["local", "export"]:
|
for view in ["local", "export"]:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user