reduce.py: Allow reducing error messages, print output in case of error (#2179)
* reduce.py: Allow reducing error messages, print output in case of error Allow reducing code that triggers (false positive) error messages. Print Cppcheck output in case Cppcheck returns unsuccessfully and no segfault is expected. This helps fixing messed up command lines (for example issues with the path). * Use "else" as suggested
This commit is contained in:
parent
fcccd5f42e
commit
bfbfeefbb3
|
@ -57,8 +57,12 @@ def runtool():
|
||||||
return True
|
return True
|
||||||
elif p.returncode == 0:
|
elif p.returncode == 0:
|
||||||
out = comm[0] + '\n' + comm[1]
|
out = comm[0] + '\n' + comm[1]
|
||||||
if 'error:' not in out and EXPECTED in out:
|
if EXPECTED in out:
|
||||||
return True
|
return True
|
||||||
|
else:
|
||||||
|
# Something could be wrong, for example the command line for Cppcheck (CMD).
|
||||||
|
# Print the output to give a hint how to fix it.
|
||||||
|
print('Error: {}\n{}'.format(comm[0], comm[1]))
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue