Skip to content
Permalink
Browse files

don't buffer python and grass tests output in variables

  • Loading branch information
jef-n committed Jul 18, 2015
1 parent 4d681f0 commit 789da22478c3e6baa1cae2219f73c2294827531f
Showing with 7 additions and 18 deletions.
  1. +1 −7 cmake/UsePythonTest.cmake
  2. +1 −7 tests/src/providers/grass/CMakeLists.txt
  3. +5 −4 tests/src/python/test_qgsserver.py
@@ -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)
"
)
@@ -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)
"
)
@@ -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
@@ -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()
@@ -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):

0 comments on commit 789da22

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