Support for engines which output into stderr
This commit is contained in:
1 parent
ef91718782
commit
a379c36e89
1 file changed
+10
-4
+10
-4
@@ -204,12 +204,18 @@ def getCutechessCommand(data, scalefactor):
|
|||||||
def singleCoreBench(name, outqueue):
|
def singleCoreBench(name, outqueue):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# Format file path because of Windows ....
|
# Format file path because of Windows ...
|
||||||
dir = os.path.join('Engines', getNameAsExe(name))
|
dir = os.path.join('Engines', getNameAsExe(name))
|
||||||
|
|
||||||
# Last two lines should hold node count and NPS
|
# Run bench from CMD, pipe stderr into stdout
|
||||||
data = os.popen('{0} bench'.format(dir)).read()
|
data, empty = subprocess.Popen(
|
||||||
data = data.strip().split('\n')
|
'{0} bench'.format(dir).split(),
|
||||||
|
stdout=subprocess.PIPE,
|
||||||
|
stderr=subprocess.STDOUT,
|
||||||
|
).communicate()
|
||||||
|
|
||||||
|
# Split line by line after decoding
|
||||||
|
data = data.decode('ascii').strip().split('\n')
|
||||||
|
|
||||||
# Parse and dump results into queue
|
# Parse and dump results into queue
|
||||||
bench = int(data[-2].split(':')[1])
|
bench = int(data[-2].split(':')[1])
|
||||||
|
|||||||
Reference in new issue
Block a user