You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
assertstderr=="{}:0:0: error: Bailing out from analysis: Checking file failed: Failed to execute addon 'naming' - exitcode is {} [internalError]\n\n^\n".format(test_file, ec)
# specify non-existent python executable so execution of addon fails
232
+
addon_json=os.path.join(tmpdir, 'addon.json')
233
+
withopen(addon_json, 'wt') asf:
234
+
f.write(json.dumps({'executable': 'notexist'}))
235
+
236
+
test_file=os.path.join(tmpdir, 'test.cpp')
237
+
withopen(test_file, 'wt') asf:
238
+
f.write("""
239
+
void f();
240
+
""")
241
+
242
+
args= [
243
+
'--addon={}'.format(addon_json),
244
+
test_file
245
+
]
246
+
247
+
_, _, stderr=cppcheck(args)
248
+
ec=1ifos.name=='nt'else127
249
+
assertstderr=="{}:0:0: error: Bailing out from analysis: Checking file failed: Failed to execute addon 'addon.json' - exitcode is {} [internalError]\n\n^\n".format(test_file, ec)
# specify non-existent python executable so execution of addon fails
254
+
addon_json=os.path.join(tmpdir, 'addon.json')
255
+
withopen(addon_json, 'wt') asf:
256
+
f.write(json.dumps({
257
+
'executable': 'notexist',
258
+
'ctu': True
259
+
}))
260
+
261
+
test_file=os.path.join(tmpdir, 'test.cpp')
262
+
withopen(test_file, 'wt') asf:
263
+
f.write("""
264
+
void f(); """)
265
+
266
+
args= [
267
+
'--template=simple',
268
+
'--addon={}'.format(addon_json),
269
+
test_file
270
+
]
271
+
272
+
_, _, stderr=cppcheck(args)
273
+
ec=1ifos.name=='nt'else127
274
+
print(stderr)
275
+
assertstderr.splitlines() == [
276
+
"{}:0:0: error: Bailing out from analysis: Checking file failed: Failed to execute addon 'addon.json' - exitcode is {} [internalError]".format(test_file, ec),
277
+
":0:0: error: Bailing out from analysis: Whole program analysis failed: Failed to execute addon 'addon.json' - exitcode is {} [internalError]".format(ec)
0 commit comments