Skip to content
Permalink
Browse files

Temporary make Grass7Utils more verbose for more travis debug

  • Loading branch information
Médéric Ribreux Médéric RIBREUX
Médéric Ribreux authored and Médéric RIBREUX committed May 24, 2016
1 parent 8884cd7 commit 1945facd1dba3ee2b2087796c9900b5f3b2808fc
@@ -261,6 +261,7 @@ def executeGrass7(commands, progress, outputCommands=None):
loglines.append(Grass7Utils.tr('GRASS GIS 7 execution console output'))
grassOutDone = False
command, grassenv = Grass7Utils.prepareGrass7Execution(commands)
print('Debug: executeGrass7\n---------------\ncommands: {}\n\ncommand: {}\n\nenv: {}'.format(commands, command, grassenv))
proc = subprocess.Popen(
command,
shell=True,
@@ -271,6 +272,7 @@ def executeGrass7(commands, progress, outputCommands=None):
env=grassenv
).stdout
for line in iter(proc.readline, ''):
print(line)
if 'GRASS_INFO_PERCENT' in line:
try:
progress.setPercentage(int(line[len('GRASS_INFO_PERCENT') + 2:]))
@@ -290,6 +292,8 @@ def executeGrass7(commands, progress, outputCommands=None):

if not grassOutDone and outputCommands:
command, grassenv = Grass7Utils.prepareGrass7Execution(outputCommands)
print('Debug: executeGrass7 outputCommands\n=============\ncommands: {}\n\ncommand: {}\n\nenv: {}'.format(commands, command, grassenv))

proc = subprocess.Popen(
command,
shell=True,
@@ -300,6 +304,7 @@ def executeGrass7(commands, progress, outputCommands=None):
env=grassenv
).stdout
for line in iter(proc.readline, ''):
print(line)
if 'GRASS_INFO_PERCENT' in line:
try:
progress.setPercentage(int(
@@ -83,8 +83,7 @@ def check_algorithm(self, name, defs):
:param defs: A python dict containing a test algorithm definition
"""
QgsMapLayerRegistry.instance().removeAllMapLayers()
print('DEBUG on {}'.format(name))
print('Params = {}'.format(defs))

params = self.load_params(defs['params'])
alg = processing.Processing.getAlgorithm(defs['algorithm']).getCopy()

@@ -185,14 +184,14 @@ def filepath_from_param(self, param):
prefix = processingTestDataPath()
if 'location' in param and param['location'] == 'qgs':
prefix = unitTestDataPath()
print('DEBUG filepath_from_param: {} -> {}'.format(param['name'], os.path.join(prefix, param['name'])))

return os.path.join(prefix, param['name'])

def check_results(self, results, expected):
"""
Checks if result produced by an algorithm matches with the expected specification.
"""
print('DEBUG check_results: results {}\n\texpected {}'.format(results, expected))

for id, expected_result in expected.items():
if 'vector' == expected_result['type']:
expected_lyr = self.load_layer(expected_result)

0 comments on commit 1945fac

Please sign in to comment.
You can’t perform that action at this time.