Salome HOME
Non regression test for bug ExtractCellType filter (PV Threshold filter)
[modules/paravis.git] / src / Plugins / MEDReader / Test / testMEDReader11.py
index 95a7b258199c164708aab8a69621efe9b8b6c154..944abb26c9053e6a10b31a8eb17b90ad8fe4f239 100644 (file)
@@ -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
@@ -192,6 +192,21 @@ RenderView1.CameraClippingRange = [2.404636927989219, 7.163736971217594]
 RenderView1.CameraFocalPoint = [2.4191999999999996, 2.4191999999999996, 4.32745]
 RenderView1.ViewTime = 2.0
 
-Render()
 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, "testMEDReader11.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()