X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FPlugins%2FMEDReader%2FTest%2FtestMEDReader6.py;h=1a76bfe93c36bbd6cd41dbba95b75e4de5deb7d8;hb=b705d58ad8589dde0c4d7fc673f1fb723c3f2ea5;hp=2154fe497f706c336561d856b2833c87511f484d;hpb=d170abf6cb7fa44827057ce004760d1ef45d9f2d;p=modules%2Fparavis.git diff --git a/src/Plugins/MEDReader/Test/testMEDReader6.py b/src/Plugins/MEDReader/Test/testMEDReader6.py index 2154fe49..1a76bfe9 100644 --- a/src/Plugins/MEDReader/Test/testMEDReader6.py +++ b/src/Plugins/MEDReader/Test/testMEDReader6.py @@ -1,10 +1,10 @@ # -*- coding: iso-8859-1 -*- -# Copyright (C) 2007-2014 CEA/DEN, EDF R&D +# Copyright (C) 2007-2015 CEA/DEN, EDF R&D # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either -# version 2.1 of the License. +# version 2.1 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -71,7 +71,7 @@ GaussPoints1.SelectSourceArray = ['CELLS','ELGA@0'] Glyph1 = Glyph( Input=GaussPoints1, GlyphType="Sphere", GlyphTransform="Transform2" ) Glyph1.GlyphType = "Sphere" Glyph1.Vectors = ['POINTS', ''] -Glyph1.SetScaleFactor = 0.29 +Glyph1.ScaleFactor = 0.29 RenderView1 = GetRenderView() RenderView1.CameraFocalPoint = [1.5, 1.5, 0.0] @@ -93,7 +93,21 @@ DataRepresentation4.ColorArrayName = 'fGauss' DataRepresentation4.LookupTable = a1_fGauss_PVLookupTable a1_fGauss_PVLookupTable.ScalarOpacityFunction = a1_fGauss_PiecewiseFunction - RenderView1.ViewSize=[300,300] -WriteImage(outImgName) +Render() +# compare with baseline image +import os +import sys +try: + baselineIndex = sys.argv.index('-B')+1 + baselinePath = sys.argv[baselineIndex] +except: + print "Could not get baseline directory. Test failed." + exit(1) +baseline_file = os.path.join(baselinePath, "testMEDReader6.png") +import vtk.test.Testing +vtk.test.Testing.VTK_TEMP_DIR = vtk.util.misc.vtkGetTempDir() +vtk.test.Testing.compareImage(GetActiveView().GetRenderWindow(), baseline_file, + threshold=25) +vtk.test.Testing.interact()