forked from qt-creator/qt-creator
Squish: Silence warnings in tst_default_settings
Change-Id: I668cc7b1fcb569b50d2178fe792f566721c9d4d4 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -139,7 +139,7 @@ def which(program):
|
||||
command = "where"
|
||||
else:
|
||||
command = "which"
|
||||
foundPath = getOutputFromCmdline([command, program])
|
||||
foundPath = getOutputFromCmdline([command, program], acceptedError=1)
|
||||
if foundPath:
|
||||
return foundPath.splitlines()[0]
|
||||
else:
|
||||
@@ -216,11 +216,12 @@ def logApplicationOutput():
|
||||
return None
|
||||
|
||||
# get the output from a given cmdline call
|
||||
def getOutputFromCmdline(cmdline, environment=None):
|
||||
def getOutputFromCmdline(cmdline, environment=None, acceptedError=0):
|
||||
try:
|
||||
return subprocess.check_output(cmdline, env=environment)
|
||||
except subprocess.CalledProcessError as e:
|
||||
test.warning("Command '%s' returned %d" % (e.cmd, e.returncode))
|
||||
if e.returncode != acceptedError:
|
||||
test.warning("Command '%s' returned %d" % (e.cmd, e.returncode))
|
||||
return e.output
|
||||
|
||||
def selectFromFileDialog(fileName, waitForFile=False):
|
||||
|
||||
Reference in New Issue
Block a user