Skip to content
Permalink
Browse files

Fix PalLabelingComposer test

Switch to QgsMultiRenderChecker and add control images for Ubuntu precise where
required.
  • Loading branch information
m-kuhn committed Nov 14, 2014
1 parent 5893289 commit ab5e0e2b37076010d8356aea93668d3cbb0158d6
Showing with 11 additions and 11 deletions.
  1. +11 −11 tests/src/python/test_qgspallabeling_base.py
  2. BIN ...testdata/control_images/expected_pal_canvas/sp_background_rect/{ → macosx}/sp_background_rect.png
  3. BIN tests/testdata/control_images/expected_pal_canvas/sp_background_rect/precise/sp_background_rect.png
  4. BIN ...mages/expected_pal_canvas/sp_background_rect_w_offset/{ → macosx}/sp_background_rect_w_offset.png
  5. BIN ...ol_images/expected_pal_canvas/sp_background_rect_w_offset/precise/sp_background_rect_w_offset.png
  6. BIN ...s/testdata/control_images/expected_pal_canvas/sp_background_svg/{ → macosx}/sp_background_svg.png
  7. BIN tests/testdata/control_images/expected_pal_canvas/sp_background_svg/precise/sp_background_svg.png
  8. BIN ..._images/expected_pal_canvas/sp_background_svg_w_offset/{ → macosx}/sp_background_svg_w_offset.png
  9. BIN ...trol_images/expected_pal_canvas/sp_background_svg_w_offset/precise/sp_background_svg_w_offset.png
  10. BIN tests/testdata/control_images/expected_pal_canvas/sp_default_label/{ → macosx}/sp_default_label.png
  11. BIN tests/testdata/control_images/expected_pal_canvas/sp_default_label/precise/sp_default_label.png
  12. BIN ..._images/expected_pal_canvas/sp_partials_labels_enabled/{ → macosx}/sp_partials_labels_enabled.png
  13. BIN ...trol_images/expected_pal_canvas/sp_partials_labels_enabled/precise/sp_partials_labels_enabled.png
  14. BIN tests/testdata/control_images/expected_pal_canvas/sp_text_color/{ → macosx}/sp_text_color.png
  15. BIN tests/testdata/control_images/expected_pal_canvas/sp_text_color/precise/sp_text_color.png
  16. BIN ...ta/control_images/expected_pal_canvas/sp_text_size_map_unit/{ → macosx}/sp_text_size_map_unit.png
  17. BIN ...stdata/control_images/expected_pal_canvas/sp_text_size_map_unit/precise/sp_text_size_map_unit.png
  18. BIN ...ontrol_images/expected_pal_composer/sp_img_background_rect/{ → macosx}/sp_img_background_rect.png
  19. BIN ...ta/control_images/expected_pal_composer/sp_img_background_rect/precise/sp_img_background_rect.png
  20. BIN ...cted_pal_composer/sp_img_background_rect_w_offset/{ → macosx}/sp_img_background_rect_w_offset.png
  21. BIN ...expected_pal_composer/sp_img_background_rect_w_offset/precise/sp_img_background_rect_w_offset.png
  22. BIN .../control_images/expected_pal_composer/sp_img_background_svg/{ → macosx}/sp_img_background_svg.png
  23. BIN ...data/control_images/expected_pal_composer/sp_img_background_svg/precise/sp_img_background_svg.png
  24. BIN ...pected_pal_composer/sp_img_background_svg_w_offset/{ → macosx}/sp_img_background_svg_w_offset.png
  25. BIN ...s/expected_pal_composer/sp_img_background_svg_w_offset/precise/sp_img_background_svg_w_offset.png
  26. BIN ...ta/control_images/expected_pal_composer/sp_img_default_label/{ → macosx}/sp_img_default_label.png
  27. BIN ...stdata/control_images/expected_pal_composer/sp_img_default_label/precise/sp_img_default_label.png
  28. BIN ...pected_pal_composer/sp_img_partials_labels_enabled/{ → macosx}/sp_img_partials_labels_enabled.png
  29. BIN ...s/expected_pal_composer/sp_img_partials_labels_enabled/precise/sp_img_partials_labels_enabled.png
  30. BIN ...testdata/control_images/expected_pal_composer/sp_img_text_color/{ → macosx}/sp_img_text_color.png
  31. BIN tests/testdata/control_images/expected_pal_composer/sp_img_text_color/precise/sp_img_text_color.png
  32. BIN ..._images/expected_pal_composer/sp_img_text_size_map_unit/{ → macosx}/sp_img_text_size_map_unit.png
  33. BIN ...trol_images/expected_pal_composer/sp_img_text_size_map_unit/precise/sp_img_text_size_map_unit.png
  34. BIN ...ontrol_images/expected_pal_composer/sp_pdf_background_rect/{ → macosx}/sp_pdf_background_rect.png
  35. BIN ...ta/control_images/expected_pal_composer/sp_pdf_background_rect/precise/sp_pdf_background_rect.png
  36. BIN ...cted_pal_composer/sp_pdf_background_rect_w_offset/{ → macosx}/sp_pdf_background_rect_w_offset.png
  37. BIN ...expected_pal_composer/sp_pdf_background_rect_w_offset/precise/sp_pdf_background_rect_w_offset.png
  38. BIN .../control_images/expected_pal_composer/sp_pdf_background_svg/{ → macosx}/sp_pdf_background_svg.png
  39. BIN ...data/control_images/expected_pal_composer/sp_pdf_background_svg/precise/sp_pdf_background_svg.png
  40. BIN ...pected_pal_composer/sp_pdf_background_svg_w_offset/{ → macosx}/sp_pdf_background_svg_w_offset.png
  41. BIN ...s/expected_pal_composer/sp_pdf_background_svg_w_offset/precise/sp_pdf_background_svg_w_offset.png
  42. BIN ...ta/control_images/expected_pal_composer/sp_pdf_default_label/{ → macosx}/sp_pdf_default_label.png
  43. BIN ...stdata/control_images/expected_pal_composer/sp_pdf_default_label/precise/sp_pdf_default_label.png
  44. BIN ...testdata/control_images/expected_pal_composer/sp_pdf_partials_labels_disabled/anomaly-precise.png
  45. BIN ...pected_pal_composer/sp_pdf_partials_labels_enabled/{ → macosx}/sp_pdf_partials_labels_enabled.png
  46. BIN ...s/expected_pal_composer/sp_pdf_partials_labels_enabled/precise/sp_pdf_partials_labels_enabled.png
  47. BIN ...testdata/control_images/expected_pal_composer/sp_pdf_text_color/{ → macosx}/sp_pdf_text_color.png
  48. BIN tests/testdata/control_images/expected_pal_composer/sp_pdf_text_color/precise/sp_pdf_text_color.png
  49. BIN ..._images/expected_pal_composer/sp_pdf_text_size_map_unit/{ → macosx}/sp_pdf_text_size_map_unit.png
  50. BIN ...trol_images/expected_pal_composer/sp_pdf_text_size_map_unit/precise/sp_pdf_text_size_map_unit.png
  51. BIN ...ontrol_images/expected_pal_composer/sp_svg_background_rect/{ → macosx}/sp_svg_background_rect.png
  52. BIN ...ta/control_images/expected_pal_composer/sp_svg_background_rect/precise/sp_svg_background_rect.png
  53. BIN ...cted_pal_composer/sp_svg_background_rect_w_offset/{ → macosx}/sp_svg_background_rect_w_offset.png
  54. BIN ...expected_pal_composer/sp_svg_background_rect_w_offset/precise/sp_svg_background_rect_w_offset.png
  55. BIN .../control_images/expected_pal_composer/sp_svg_background_svg/{ → macosx}/sp_svg_background_svg.png
  56. BIN ...data/control_images/expected_pal_composer/sp_svg_background_svg/precise/sp_svg_background_svg.png
  57. BIN ...pected_pal_composer/sp_svg_background_svg_w_offset/{ → macosx}/sp_svg_background_svg_w_offset.png
  58. BIN ...s/expected_pal_composer/sp_svg_background_svg_w_offset/precise/sp_svg_background_svg_w_offset.png
  59. BIN ...ta/control_images/expected_pal_composer/sp_svg_default_label/{ → macosx}/sp_svg_default_label.png
  60. BIN ...stdata/control_images/expected_pal_composer/sp_svg_default_label/precise/sp_svg_default_label.png
  61. BIN ...pected_pal_composer/sp_svg_partials_labels_enabled/{ → macosx}/sp_svg_partials_labels_enabled.png
  62. BIN ...s/expected_pal_composer/sp_svg_partials_labels_enabled/precise/sp_svg_partials_labels_enabled.png
  63. BIN ...testdata/control_images/expected_pal_composer/sp_svg_text_color/{ → macosx}/sp_svg_text_color.png
  64. BIN tests/testdata/control_images/expected_pal_composer/sp_svg_text_color/precise/sp_svg_text_color.png
  65. BIN ..._images/expected_pal_composer/sp_svg_text_size_map_unit/{ → macosx}/sp_svg_text_size_map_unit.png
  66. BIN ...trol_images/expected_pal_composer/sp_svg_text_size_map_unit/precise/sp_svg_text_size_map_unit.png
  67. BIN ...testdata/control_images/expected_pal_server/sp_background_rect/{ → macosx}/sp_background_rect.png
  68. BIN tests/testdata/control_images/expected_pal_server/sp_background_rect/precise/sp_background_rect.png
  69. BIN ...mages/expected_pal_server/sp_background_rect_w_offset/{ → macosx}/sp_background_rect_w_offset.png
  70. BIN ...ol_images/expected_pal_server/sp_background_rect_w_offset/precise/sp_background_rect_w_offset.png
  71. BIN ...s/testdata/control_images/expected_pal_server/sp_background_svg/{ → macosx}/sp_background_svg.png
  72. BIN tests/testdata/control_images/expected_pal_server/sp_background_svg/precise/sp_background_svg.png
  73. BIN ..._images/expected_pal_server/sp_background_svg_w_offset/{ → macosx}/sp_background_svg_w_offset.png
  74. BIN ...trol_images/expected_pal_server/sp_background_svg_w_offset/precise/sp_background_svg_w_offset.png
  75. BIN tests/testdata/control_images/expected_pal_server/sp_default_label/{ → macosx}/sp_default_label.png
  76. BIN tests/testdata/control_images/expected_pal_server/sp_default_label/precise/sp_default_label.png
  77. BIN ..._images/expected_pal_server/sp_partials_labels_enabled/{ → macosx}/sp_partials_labels_enabled.png
  78. BIN ...trol_images/expected_pal_server/sp_partials_labels_enabled/precise/sp_partials_labels_enabled.png
  79. BIN tests/testdata/control_images/expected_pal_server/sp_text_color/{ → macosx}/sp_text_color.png
  80. BIN tests/testdata/control_images/expected_pal_server/sp_text_color/precise/sp_text_color.png
  81. BIN ...ta/control_images/expected_pal_server/sp_text_size_map_unit/{ → macosx}/sp_text_size_map_unit.png
  82. BIN ...stdata/control_images/expected_pal_server/sp_text_size_map_unit/precise/sp_text_size_map_unit.png
@@ -38,7 +38,7 @@
QgsPalLayerSettings,
QgsProviderRegistry,
QgsVectorLayer,
QgsRenderChecker
QgsMultiRenderChecker
)

from utilities import (
@@ -345,23 +345,23 @@ def renderCheck(self, mismatch=0, colortol=0, imgpath='', grpprefix=''):
"""
if not grpprefix:
grpprefix = self._TestGroupPrefix
ctl_path = self.controlImagePath(grpprefix)
if not os.path.exists(ctl_path):
raise OSError('Missing control image: {0}'.format(ctl_path))
chk = QgsRenderChecker()
chk = QgsMultiRenderChecker()

chk.setControlPathPrefix('expected_' + grpprefix)

chk.setControlName(self._Test)
chk.setColorTolerance(colortol)

if imgpath:
chk.setRenderedImage(imgpath)

ms = self._MapSettings # class settings
if self._TestMapSettings is not None:
ms = self._TestMapSettings # per test settings
chk.setMapSettings(ms)

chk.setColorTolerance(colortol)
# noinspection PyUnusedLocal
res = False
if imgpath:
res = chk.compareImages(self._Test, mismatch, str(imgpath))
else:
res = chk.runTest(self._Test, mismatch)
res = chk.runTest(self._Test, mismatch)
if PALREPORT and not res: # don't report ok checks
testname = self._TestGroup + ' . ' + self._Test
PALREPORTS[testname] = str(chk.report().toLocal8Bit())
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.

0 comments on commit ab5e0e2

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