Skip to content

Commit

Permalink
Upload images from python composer check to cdash, fix frame of pytho…
Browse files Browse the repository at this point in the history
…n composer test
  • Loading branch information
Marco Hugentobler committed Aug 29, 2012
1 parent ad437bf commit a4c709e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 11 deletions.
10 changes: 2 additions & 8 deletions tests/src/python/qgscompositionchecker.py
Expand Up @@ -47,14 +47,8 @@ def testComposition(self, mTestName, mComposition, mExpectedImageFile, page=0
diffFilePath = QDir.tempPath() + QDir.separator() + QFileInfo( mExpectedImageFile ).baseName() + "_diff_python.png"
testResult = self.compareImages( expectedImage, outputImage, diffFilePath )

# myDashMessage = "<DartMeasurementFile name=\"Rendered Image " + mTestName + "\"
# " type=\"image/png\">" + renderedFilePath +
# "</DartMeasurementFile>"
# "<DartMeasurementFile name=\"Expected Image " + mTestName + "\" type=\"image/png\">" +
# mExpectedImageFile + "</DartMeasurementFile>"
# "<DartMeasurementFile name=\"Difference Image " + mTestName + "\" type=\"image/png\">" +
# diffFilePath + "</DartMeasurementFile>"

myDashMessage = "<DartMeasurementFile name=\"Rendered Image " + mTestName + "\"" + " type=\"image/png\">" + renderedFilePath + "</DartMeasurementFile>" + "\n" + "<DartMeasurementFile name=\"Expected Image " + mTestName + "\"" + " type=\"image/png\">" + mExpectedImageFile + "</DartMeasurementFile>" + "\n" + "<DartMeasurementFile name=\"Difference Image " + mTestName + "\"" + " type=\"image/png\">" + diffFilePath + "</DartMeasurementFile>"
qDebug( myDashMessage )
return testResult

def compareImages( self, imgExpected, imgRendered, differenceImagePath ):
Expand Down
7 changes: 4 additions & 3 deletions tests/src/python/test_qgscomposermap.py
Expand Up @@ -43,6 +43,7 @@ def testCase(self):
mComposition = QgsComposition( mMapRenderer )
mComposition.setPaperSize( 297, 210 )
mComposerMap = QgsComposerMap( mComposition, 20, 20, 200, 100 )
mComposerMap.setFrameEnabled( True )
mComposition.addComposerMap( mComposerMap )
self.grid(mComposerMap, mComposition, TEST_DATA_DIR)
self.overviewMap(mComposerMap, mComposition, TEST_DATA_DIR)
Expand All @@ -65,12 +66,12 @@ def grid(self, mComposerMap, mComposition, TEST_DATA_DIR):
testResult = checker.testComposition( "Composer map grid", mComposition, TEST_DATA_DIR + QDir().separator().toAscii() + "control_images" + QDir().separator().toAscii() + "expected_composermap" + QDir().separator().toAscii() + "composermap_landsat_grid.png" )
mComposerMap.setGridEnabled( False )
mComposerMap.setShowGridAnnotation( False )
mTestName = "gaga"
# myMessage = "<DartMeasurementFile name=\"Rendered Image " + mTestName + "\" type=\"image/png\">" + renderedFilePath + "</DartMeasurementFile> <DartMeasurementFile name=\"Expected Image " + mTestName + "\" type=\"image/png\">" + mExpectedImageFile + "</DartMeasurementFile> <DartMeasurementFile name=\"Difference Image " + mTestName + "\" type=\"image/png\">" + diffFilePath + "</DartMeasurementFile>"
assert testResult == True #, myMessage

assert testResult == True

def overviewMap(self, mComposerMap, mComposition, TEST_DATA_DIR):
overviewMap = QgsComposerMap( mComposition, 20, 130, 70, 70 )
overviewMap.setFrameEnabled( True )
mComposition.addComposerMap( overviewMap )
# zoom in
mComposerMap.setNewExtent( QgsRectangle( 785462.375, 3341423.125, 789262.375, 3343323.125 ) )
Expand Down

0 comments on commit a4c709e

Please sign in to comment.