Skip to content

Commit 789da22

Browse files
committed
don't buffer python and grass tests output in variables
1 parent 4d681f0 commit 789da22

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

cmake/UsePythonTest.cmake

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,17 +50,11 @@ MESSAGE(\"PYTHONPATH:\$ENV{PYTHONPATH}\")
5050
MESSAGE(STATUS \"Running ${PYTHON_EXECUTABLE} ${loc} ${wo_semicolon}\")
5151
EXECUTE_PROCESS(
5252
COMMAND ${PYTHON_EXECUTABLE} ${loc} ${wo_semicolumn}
53-
#WORKING_DIRECTORY @LIBRARY_OUTPUT_PATH@
5453
RESULT_VARIABLE import_res
55-
OUTPUT_VARIABLE import_output
56-
ERROR_VARIABLE import_output
5754
)
5855
# Pass the output back to ctest
59-
IF(import_output)
60-
MESSAGE(" \${import_output} ")
61-
ENDIF(import_output)
6256
IF(import_res)
63-
MESSAGE(SEND_ERROR " \${import_res} ")
57+
MESSAGE(FATAL_ERROR \"Test failed: \${import_res}\")
6458
ENDIF(import_res)
6559
"
6660
)

tests/src/providers/grass/CMakeLists.txt

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,9 @@ MESSAGE(STATUS \"Running ${CMAKE_BINARY_DIR}/output/bin/\${CMAKE_BUILD_TYPE}/qgi
3131
EXECUTE_PROCESS(
3232
COMMAND ${CMAKE_BINARY_DIR}/output/bin/\${CMAKE_BUILD_TYPE}/qgis_${testname}${grass_build_version}
3333
RESULT_VARIABLE import_res
34-
OUTPUT_VARIABLE import_output
35-
ERROR_VARIABLE import_output
3634
)
37-
# Pass the output back to ctest
38-
IF(import_output)
39-
MESSAGE(" \${import_output} ")
40-
ENDIF(import_output)
4135
IF(import_res)
42-
MESSAGE(SEND_ERROR " \${import_res} ")
36+
MESSAGE(FATAL_ERROR \"Test failed: \${import_res}\")
4337
ENDIF(import_res)
4438
"
4539
)

tests/src/python/test_qgsserver.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import os
1616
import re
1717
import unittest
18-
import tempfile
1918
from qgis.server import QgsServer
2019
from qgis.core import QgsMessageLog
2120
from utilities import unitTestDataPath
@@ -103,8 +102,10 @@ def responseComplete(self):
103102

104103
## WMS tests
105104
def wms_request_compare(self, request):
106-
map = self.testdata_path + "testproject.qgs"
107-
query_string = 'MAP=%s&SERVICE=WMS&VERSION=1.3&REQUEST=%s' % (map, request)
105+
project = self.testdata_path + "testproject.qgs"
106+
assert os.path.exists(project), "Project file not found: " + project
107+
108+
query_string = 'MAP=%s&SERVICE=WMS&VERSION=1.3&REQUEST=%s' % (project, request)
108109
response = str(self.server.handleRequest(query_string))
109110
f = open(self.testdata_path + request.lower() + '.txt')
110111
expected = f.read()
@@ -120,7 +121,7 @@ def wms_request_compare(self, request):
120121
"""
121122
response = re.sub(RE_STRIP_PATH, '', response)
122123
expected = re.sub(RE_STRIP_PATH, '', expected)
123-
self.assertEqual(response, expected, msg="request %s failed. Expected:\n%s\n\nResponse:\n%s" % (request, expected, response))
124+
self.assertEqual(response, expected, msg="request %s failed.\n Query: %s\n Expected:\n%s\n\n Response:\n%s" % (query_string, request, expected, response))
124125

125126

126127
def test_project_wms(self):

0 commit comments

Comments
 (0)