mirror of https://github.com/CGAL/cgal
Merge pull request #6027 from lrineau/Testsuite-fix_warnings_detection-GF
Fix detection of warnings in test results
This commit is contained in:
commit
279db63ccb
|
|
@ -53,19 +53,19 @@ print_testresult()
|
|||
# 'QMessageBox::warning'.
|
||||
if grep -v -F 'CMake Warning at /usr/share/cmake/Modules/FindBoost' CompilerOutput_$1 ProgramOutput.*.$1 | grep -i -E -q '(^|[^a-zA-Z_,:-])warning'
|
||||
then
|
||||
if grep -v -F 'CMake Warning at /usr/share/cmake/Modules/FindBoost' CompilerOutput_$1 ProgramOutput.*.$1 | grep -i -E '(^|[^a-zA-Z_,:-])warning' | grep -i -q "include[/\]CGAL\|cmake"
|
||||
if grep -v -F 'CMake Warning at /usr/share/cmake/Modules/FindBoost' CompilerOutput_$1 ProgramOutput.*.$1 | grep -i -E '(^|[^a-zA-Z_,:-])warning' | grep -i -q "include[/\]CGAL\|cmake\|CGAL warning"
|
||||
then
|
||||
RESULT="w"
|
||||
else
|
||||
RESULT="t"
|
||||
fi
|
||||
else
|
||||
if grep -E -q 'NOTICE: .*(need|require|incompatible).*and.*will not be' CompilerOutput_$1
|
||||
then
|
||||
RESULT="r"
|
||||
if grep -E -q 'NOTICE: .*(need|require|incompatible).*and.*will not be' CompilerOutput_$1
|
||||
then
|
||||
RESULT="r"
|
||||
else
|
||||
RESULT="y"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
TIMING=`awk '/^ # Running time: / {print $4}' < ErrorOutput_$1`
|
||||
|
|
|
|||
|
|
@ -76,19 +76,20 @@ for t_id in range(0, len(tests)):
|
|||
labels.add(label)
|
||||
tests_per_label[label].append(t)
|
||||
|
||||
warning_pattern=re.compile(r'(.*([^a-zA-Z_,:-])([^\d]\s)warning).*?(\[|\n)', flags=re.IGNORECASE)
|
||||
warning_pattern=re.compile(r'(.*([^a-zA-Z_,:-])warning)', flags=re.IGNORECASE)
|
||||
w_det=re.compile("warning");
|
||||
filter_pattern=re.compile(r'cmake|cgal', flags=re.IGNORECASE);
|
||||
with open_file_create_dir(result_file_name.format(dir=os.getcwd(),
|
||||
tester=tester_name,
|
||||
platform=platform_name), 'a+') as results:
|
||||
for label, tests in tests_per_label.items():
|
||||
counts={"n": 0, "w": 0, "t": 0}
|
||||
result_for_label='y'
|
||||
with open_file_create_dir("{}/error.txt".format(label), 'w') as error:
|
||||
for t in tests:
|
||||
print(" {result} {name} in {time} s : {value} ".format(result = "successful " if (t['Status'] == 'passed') else "ERROR: ", name = t['Name'], value = t['ExitValue'] if(t['ExitValue'] != "") else "SUCCESS" , time = t['ExecutionTime']), file=error)
|
||||
if t['Status'] != 'passed':
|
||||
result_for_label='n'
|
||||
counts["n"]+=1
|
||||
elif t['Output'] != None and w_det.search(t['Output']):
|
||||
entries = re.split("\n+", t['Output'])
|
||||
for entry in entries:
|
||||
|
|
@ -96,15 +97,21 @@ with open_file_create_dir(result_file_name.format(dir=os.getcwd(),
|
|||
if m:
|
||||
n = filter_pattern.search(m.group(0))
|
||||
if n:
|
||||
result_for_label='w'
|
||||
counts["w"]+=1
|
||||
break;
|
||||
else:
|
||||
result_for_label='t'
|
||||
counts["t"]+=1
|
||||
|
||||
with io.open("{}/ProgramOutput.{}".format(label, t['Name']), mode="w", encoding="utf-8") as f:
|
||||
print("{}/ProgramOutput.{}".format(label, t['Name']))
|
||||
f.write(t['Output'] if t['Output'] != None else "")
|
||||
|
||||
if counts["n"] > 0:
|
||||
result_for_label='n'
|
||||
elif counts["w"] > 0:
|
||||
result_for_label='w'
|
||||
elif counts["t"] > 0:
|
||||
result_for_label='t'
|
||||
|
||||
print("{label} {result}".format(label=label, result=result_for_label), file=results)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue