We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1c92170 commit 40aefa1Copy full SHA for 40aefa1
1 file changed
addons/test/util.py
@@ -1,9 +1,25 @@
1
# Helpers for pytest tests
2
import subprocess
3
import json
4
+import os
5
+
6
7
+def find_cppcheck_binary():
8
+ possible_locations = [
9
+ "./cppcheck",
10
+ r".\bin\cppcheck.exe",
11
+ ]
12
+ for location in possible_locations:
13
+ if os.path.exists(location):
14
+ break
15
+ else:
16
+ raise RuntimeError("Could not fine cppcheck binary")
17
18
+ return location
19
20
def dump_create(fpath, *argv):
- cmd = ["./cppcheck", "--dump", "--quiet", fpath] + list(argv)
21
+ cppcheck_binary = find_cppcheck_binary()
22
+ cmd = [cppcheck_binary, "--dump", "--quiet", fpath] + list(argv)
23
p = subprocess.Popen(cmd)
24
p.communicate()
25
if p.returncode != 0:
0 commit comments