Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
don't buffer python and grass tests output in variables
  • Loading branch information
jef-n committed Jul 18, 2015
1 parent 4d681f0 commit 789da22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 18 deletions.
8 changes: 1 addition & 7 deletions cmake/UsePythonTest.cmake
Expand Up @@ -50,17 +50,11 @@ MESSAGE(\"PYTHONPATH:\$ENV{PYTHONPATH}\")
MESSAGE(STATUS \"Running ${PYTHON_EXECUTABLE} ${loc} ${wo_semicolon}\")
EXECUTE_PROCESS(
COMMAND ${PYTHON_EXECUTABLE} ${loc} ${wo_semicolumn}
#WORKING_DIRECTORY @LIBRARY_OUTPUT_PATH@
RESULT_VARIABLE import_res
OUTPUT_VARIABLE import_output
ERROR_VARIABLE import_output
)
# Pass the output back to ctest
IF(import_output)
MESSAGE(" \${import_output} ")
ENDIF(import_output)
IF(import_res)
MESSAGE(SEND_ERROR " \${import_res} ")
MESSAGE(FATAL_ERROR \"Test failed: \${import_res}\")
ENDIF(import_res)
"
)
Expand Down
8 changes: 1 addition & 7 deletions tests/src/providers/grass/CMakeLists.txt
Expand Up @@ -31,15 +31,9 @@ MESSAGE(STATUS \"Running ${CMAKE_BINARY_DIR}/output/bin/\${CMAKE_BUILD_TYPE}/qgi
EXECUTE_PROCESS(
COMMAND ${CMAKE_BINARY_DIR}/output/bin/\${CMAKE_BUILD_TYPE}/qgis_${testname}${grass_build_version}
RESULT_VARIABLE import_res
OUTPUT_VARIABLE import_output
ERROR_VARIABLE import_output
)
# Pass the output back to ctest
IF(import_output)
MESSAGE(" \${import_output} ")
ENDIF(import_output)
IF(import_res)
MESSAGE(SEND_ERROR " \${import_res} ")
MESSAGE(FATAL_ERROR \"Test failed: \${import_res}\")
ENDIF(import_res)
"
)
Expand Down
9 changes: 5 additions & 4 deletions tests/src/python/test_qgsserver.py
Expand Up @@ -15,7 +15,6 @@
import os
import re
import unittest
import tempfile
from qgis.server import QgsServer
from qgis.core import QgsMessageLog
from utilities import unitTestDataPath
Expand Down Expand Up @@ -103,8 +102,10 @@ def responseComplete(self):

## WMS tests
def wms_request_compare(self, request):
map = self.testdata_path + "testproject.qgs"
query_string = 'MAP=%s&SERVICE=WMS&VERSION=1.3&REQUEST=%s' % (map, request)
project = self.testdata_path + "testproject.qgs"
assert os.path.exists(project), "Project file not found: " + project

query_string = 'MAP=%s&SERVICE=WMS&VERSION=1.3&REQUEST=%s' % (project, request)
response = str(self.server.handleRequest(query_string))
f = open(self.testdata_path + request.lower() + '.txt')
expected = f.read()
Expand All @@ -120,7 +121,7 @@ def wms_request_compare(self, request):
"""
response = re.sub(RE_STRIP_PATH, '', response)
expected = re.sub(RE_STRIP_PATH, '', expected)
self.assertEqual(response, expected, msg="request %s failed. Expected:\n%s\n\nResponse:\n%s" % (request, expected, response))
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))


def test_project_wms(self):
Expand Down

0 comments on commit 789da22

Please sign in to comment.