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'.
|
# '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'
|
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
|
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
|
then
|
||||||
RESULT="w"
|
RESULT="w"
|
||||||
else
|
else
|
||||||
RESULT="t"
|
RESULT="t"
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if grep -E -q 'NOTICE: .*(need|require|incompatible).*and.*will not be' CompilerOutput_$1
|
if grep -E -q 'NOTICE: .*(need|require|incompatible).*and.*will not be' CompilerOutput_$1
|
||||||
then
|
then
|
||||||
RESULT="r"
|
RESULT="r"
|
||||||
else
|
else
|
||||||
RESULT="y"
|
RESULT="y"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
TIMING=`awk '/^ # Running time: / {print $4}' < ErrorOutput_$1`
|
TIMING=`awk '/^ # Running time: / {print $4}' < ErrorOutput_$1`
|
||||||
|
|
|
||||||
|
|
@ -76,19 +76,20 @@ for t_id in range(0, len(tests)):
|
||||||
labels.add(label)
|
labels.add(label)
|
||||||
tests_per_label[label].append(t)
|
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");
|
w_det=re.compile("warning");
|
||||||
filter_pattern=re.compile(r'cmake|cgal', flags=re.IGNORECASE);
|
filter_pattern=re.compile(r'cmake|cgal', flags=re.IGNORECASE);
|
||||||
with open_file_create_dir(result_file_name.format(dir=os.getcwd(),
|
with open_file_create_dir(result_file_name.format(dir=os.getcwd(),
|
||||||
tester=tester_name,
|
tester=tester_name,
|
||||||
platform=platform_name), 'a+') as results:
|
platform=platform_name), 'a+') as results:
|
||||||
for label, tests in tests_per_label.items():
|
for label, tests in tests_per_label.items():
|
||||||
|
counts={"n": 0, "w": 0, "t": 0}
|
||||||
result_for_label='y'
|
result_for_label='y'
|
||||||
with open_file_create_dir("{}/error.txt".format(label), 'w') as error:
|
with open_file_create_dir("{}/error.txt".format(label), 'w') as error:
|
||||||
for t in tests:
|
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)
|
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':
|
if t['Status'] != 'passed':
|
||||||
result_for_label='n'
|
counts["n"]+=1
|
||||||
elif t['Output'] != None and w_det.search(t['Output']):
|
elif t['Output'] != None and w_det.search(t['Output']):
|
||||||
entries = re.split("\n+", t['Output'])
|
entries = re.split("\n+", t['Output'])
|
||||||
for entry in entries:
|
for entry in entries:
|
||||||
|
|
@ -96,15 +97,21 @@ with open_file_create_dir(result_file_name.format(dir=os.getcwd(),
|
||||||
if m:
|
if m:
|
||||||
n = filter_pattern.search(m.group(0))
|
n = filter_pattern.search(m.group(0))
|
||||||
if n:
|
if n:
|
||||||
result_for_label='w'
|
counts["w"]+=1
|
||||||
break;
|
break;
|
||||||
else:
|
else:
|
||||||
result_for_label='t'
|
counts["t"]+=1
|
||||||
|
|
||||||
with io.open("{}/ProgramOutput.{}".format(label, t['Name']), mode="w", encoding="utf-8") as f:
|
with io.open("{}/ProgramOutput.{}".format(label, t['Name']), mode="w", encoding="utf-8") as f:
|
||||||
print("{}/ProgramOutput.{}".format(label, t['Name']))
|
print("{}/ProgramOutput.{}".format(label, t['Name']))
|
||||||
f.write(t['Output'] if t['Output'] != None else "")
|
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)
|
print("{label} {result}".format(label=label, result=result_for_label), file=results)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue