From: Cédric Aguerre Date: Fri, 20 May 2016 09:52:49 +0000 (+0200) Subject: [For eval] add image comparison X-Git-Tag: V8_1_0a1^0 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=934adc48899c6c3e5547a8644ec6424f2a0838bc;p=modules%2Fparavis.git [For eval] add image comparison --- diff --git a/test/VisuPrs/3D_viewer/A1.py b/test/VisuPrs/3D_viewer/A1.py index c8e1d2a2..b9072293 100644 --- a/test/VisuPrs/3D_viewer/A1.py +++ b/test/VisuPrs/3D_viewer/A1.py @@ -98,7 +98,13 @@ for reprCode in represents: # save picture in file # Construct image file name - pic_name = picturedir + "params_" + repr.replace(' ', '_') + "_any_" + \ + base_name = "params_" + repr.replace(' ', '_') + "_any_" + \ str(sha) + "_" + str(opa) + "_" + str(lwi) + "." + pictureext + pic_name = os.path.join(picturedir, base_name) # Show and record the presentation process_prs_for_test(plot3d, my_view, pic_name) + + # Compare to baseline + current_dir = os.path.dirname(os.path.realpath(__file__)) + baseline = os.path.join(current_dir, "_refs", base_name) + compare_view_to_ref_image(my_view, baseline, threshold=1) diff --git a/test/VisuPrs/3D_viewer/CMakeLists.txt b/test/VisuPrs/3D_viewer/CMakeLists.txt index ccd21f10..0e01eab4 100755 --- a/test/VisuPrs/3D_viewer/CMakeLists.txt +++ b/test/VisuPrs/3D_viewer/CMakeLists.txt @@ -41,3 +41,4 @@ INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${TEST_INSTALL_DIRECTORY} RENAME CTestTestfile.cmake) INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY}) +INSTALL(DIRECTORY _refs DESTINATION ${TEST_INSTALL_DIRECTORY}) diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.0_1.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.0_10.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.0_3.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.5_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.5_1.0.png new file mode 100644 index 00000000..f0eb92c5 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.5_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.5_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.5_10.0.png new file mode 100644 index 00000000..0990cb70 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.5_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.5_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.5_3.0.png new file mode 100644 index 00000000..ca4840cd Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_0.5_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_1.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_1.0_1.0.png new file mode 100644 index 00000000..8044e2fd Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_1.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_1.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_1.0_10.0.png new file mode 100644 index 00000000..86e016e7 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_1.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_1.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_1.0_3.0.png new file mode 100644 index 00000000..a844ff32 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Flat_1.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.0_1.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.0_10.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.0_3.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.5_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.5_1.0.png new file mode 100644 index 00000000..f0eb92c5 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.5_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.5_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.5_10.0.png new file mode 100644 index 00000000..0990cb70 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.5_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.5_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.5_3.0.png new file mode 100644 index 00000000..ca4840cd Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_0.5_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_1.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_1.0_1.0.png new file mode 100644 index 00000000..8044e2fd Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_1.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_1.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_1.0_10.0.png new file mode 100644 index 00000000..86e016e7 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_1.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_1.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_1.0_3.0.png new file mode 100644 index 00000000..a844ff32 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Points_any_Gouraud_1.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.0_1.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.0_10.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.0_3.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.5_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.5_1.0.png new file mode 100644 index 00000000..5591a6ca Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.5_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.5_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.5_10.0.png new file mode 100644 index 00000000..46687c86 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.5_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.5_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.5_3.0.png new file mode 100644 index 00000000..ea567663 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_0.5_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_1.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_1.0_1.0.png new file mode 100644 index 00000000..b6c5af5b Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_1.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_1.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_1.0_10.0.png new file mode 100644 index 00000000..af95f61d Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_1.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_1.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_1.0_3.0.png new file mode 100644 index 00000000..27a7be0c Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Flat_1.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.0_1.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.0_10.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.0_3.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.5_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.5_1.0.png new file mode 100644 index 00000000..5591a6ca Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.5_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.5_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.5_10.0.png new file mode 100644 index 00000000..46687c86 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.5_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.5_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.5_3.0.png new file mode 100644 index 00000000..ea567663 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_0.5_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_1.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_1.0_1.0.png new file mode 100644 index 00000000..b6c5af5b Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_1.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_1.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_1.0_10.0.png new file mode 100644 index 00000000..af95f61d Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_1.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_1.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_1.0_3.0.png new file mode 100644 index 00000000..27a7be0c Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Surface_any_Gouraud_1.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.0_1.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.0_10.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.0_3.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.5_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.5_1.0.png new file mode 100644 index 00000000..5591a6ca Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.5_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.5_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.5_10.0.png new file mode 100644 index 00000000..46687c86 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.5_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.5_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.5_3.0.png new file mode 100644 index 00000000..ea567663 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_0.5_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_1.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_1.0_1.0.png new file mode 100644 index 00000000..b6c5af5b Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_1.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_1.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_1.0_10.0.png new file mode 100644 index 00000000..af95f61d Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_1.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_1.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_1.0_3.0.png new file mode 100644 index 00000000..27a7be0c Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Flat_1.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.0_1.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.0_10.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.0_3.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.5_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.5_1.0.png new file mode 100644 index 00000000..5591a6ca Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.5_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.5_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.5_10.0.png new file mode 100644 index 00000000..46687c86 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.5_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.5_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.5_3.0.png new file mode 100644 index 00000000..ea567663 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_0.5_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_1.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_1.0_1.0.png new file mode 100644 index 00000000..b6c5af5b Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_1.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_1.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_1.0_10.0.png new file mode 100644 index 00000000..af95f61d Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_1.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_1.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_1.0_3.0.png new file mode 100644 index 00000000..27a7be0c Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Volume_any_Gouraud_1.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.0_1.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.0_10.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.0_3.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.5_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.5_1.0.png new file mode 100644 index 00000000..edd919e3 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.5_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.5_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.5_10.0.png new file mode 100644 index 00000000..9624ad19 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.5_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.5_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.5_3.0.png new file mode 100644 index 00000000..d1d95359 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_0.5_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_1.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_1.0_1.0.png new file mode 100644 index 00000000..5bbce681 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_1.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_1.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_1.0_10.0.png new file mode 100644 index 00000000..27b95697 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_1.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_1.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_1.0_3.0.png new file mode 100644 index 00000000..86989a16 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Flat_1.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.0_1.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.0_10.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.0_3.0.png new file mode 100644 index 00000000..2a615809 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.0_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.5_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.5_1.0.png new file mode 100644 index 00000000..edd919e3 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.5_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.5_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.5_10.0.png new file mode 100644 index 00000000..9624ad19 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.5_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.5_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.5_3.0.png new file mode 100644 index 00000000..d1d95359 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_0.5_3.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_1.0_1.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_1.0_1.0.png new file mode 100644 index 00000000..5bbce681 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_1.0_1.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_1.0_10.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_1.0_10.0.png new file mode 100644 index 00000000..27b95697 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_1.0_10.0.png differ diff --git a/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_1.0_3.0.png b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_1.0_3.0.png new file mode 100644 index 00000000..86989a16 Binary files /dev/null and b/test/VisuPrs/3D_viewer/_refs/params_Wireframe_any_Gouraud_1.0_3.0.png differ diff --git a/test/VisuPrs/ScalarMap/CMakeLists.txt b/test/VisuPrs/ScalarMap/CMakeLists.txt index 1d8c45fd..b23aefca 100644 --- a/test/VisuPrs/ScalarMap/CMakeLists.txt +++ b/test/VisuPrs/ScalarMap/CMakeLists.txt @@ -41,3 +41,4 @@ INSTALL(FILES CTestTestfileInstall.cmake DESTINATION ${TEST_INSTALL_DIRECTORY} RENAME CTestTestfile.cmake) INSTALL(FILES tests.set DESTINATION ${TEST_INSTALL_DIRECTORY}) +INSTALL(DIRECTORY _refs DESTINATION ${TEST_INSTALL_DIRECTORY}) diff --git a/test/VisuPrs/ScalarMap/G2.py b/test/VisuPrs/ScalarMap/G2.py index d8eda874..2f4ea4df 100644 --- a/test/VisuPrs/ScalarMap/G2.py +++ b/test/VisuPrs/ScalarMap/G2.py @@ -22,7 +22,7 @@ import sys import os -from paravistest import datadir, pictureext, get_picture_dir, get_png_picture_resolution +from paravistest import datadir, pictureext, get_picture_dir, compare_view_to_ref_image from pvsimple import GetActiveSource, GetRenderView, Render, OpenDataFile from presentations import ScalarMapOnField, hide_all, EntityType, PrsTypeEnum,reset_view,process_prs_for_test @@ -48,9 +48,6 @@ import time aFieldEntity = EntityType.NODE aFieldName = "MODES___DEPL____________________" -#create list to store picture files sizes -sizesw=[] -sizesh=[] #create Scalar Map presentations for 10 timestamps for i in range(1,11): hide_all(aView, True) @@ -62,36 +59,19 @@ for i in range(1,11): reset_view(aView) Render(aView) - # Add path separator to the end of picture path if necessery - if not picturedir.endswith(os.sep): - picturedir += os.sep prs_type = PrsTypeEnum.SCALARMAP # Get name of presentation type prs_name = PrsTypeEnum.get_name(prs_type) f_prs_type = prs_name.replace(' ', '').upper() # Construct image file name - pic_name = picturedir + aFieldName + "_" + str(i) + "_" + f_prs_type + "." + pictureext + base_name = aFieldName + "_" + str(i) + "_" + f_prs_type + "." + pictureext + pic_name = os.path.join(picturedir, base_name) # Show and record the presentation process_prs_for_test(aPrs, aView, pic_name) - (w,h) = get_png_picture_resolution(pic_name) - sizesw.append(w) - sizesh.append(h) - -# check sizes of pictures: width -if abs(max(sizesw)-min(sizesw)) > 0: - print "ERROR!!! Pictures have different width !!!"; - for i in range(1,11): - picture_name = "time_stamp_"+str(i)+"."+pictureext - print "Picture: "+picture_name+"; width : "+str(sizesw[i-1]) - raise RuntimeError - -# check sizes of pictures: height -if abs(max(sizesh)-min(sizesh)) > 0: - print "WARNING!!! Pictures have different height !!!"; - for i in range(1,11): - picture_name = "time_stamp_"+str(i)+"."+pictureext - print "Picture: "+picture_name+"; height : "+str(sizesh[i-1]) - raise RuntimeError + # Compare to baseline + current_dir = os.path.dirname(os.path.realpath(__file__)) + baseline = os.path.join(current_dir, "_refs", base_name) + compare_view_to_ref_image(aView, baseline, threshold=1) diff --git a/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________10_SCALARMAP.png b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________10_SCALARMAP.png new file mode 100644 index 00000000..73341540 Binary files /dev/null and b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________10_SCALARMAP.png differ diff --git a/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________1_SCALARMAP.png b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________1_SCALARMAP.png new file mode 100644 index 00000000..d33080fd Binary files /dev/null and b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________1_SCALARMAP.png differ diff --git a/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________2_SCALARMAP.png b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________2_SCALARMAP.png new file mode 100644 index 00000000..8d0d5e66 Binary files /dev/null and b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________2_SCALARMAP.png differ diff --git a/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________3_SCALARMAP.png b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________3_SCALARMAP.png new file mode 100644 index 00000000..0963b127 Binary files /dev/null and b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________3_SCALARMAP.png differ diff --git a/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________4_SCALARMAP.png b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________4_SCALARMAP.png new file mode 100644 index 00000000..30f86471 Binary files /dev/null and b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________4_SCALARMAP.png differ diff --git a/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________5_SCALARMAP.png b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________5_SCALARMAP.png new file mode 100644 index 00000000..631467cb Binary files /dev/null and b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________5_SCALARMAP.png differ diff --git a/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________6_SCALARMAP.png b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________6_SCALARMAP.png new file mode 100644 index 00000000..9e70cb64 Binary files /dev/null and b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________6_SCALARMAP.png differ diff --git a/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________7_SCALARMAP.png b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________7_SCALARMAP.png new file mode 100644 index 00000000..51992e94 Binary files /dev/null and b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________7_SCALARMAP.png differ diff --git a/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________8_SCALARMAP.png b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________8_SCALARMAP.png new file mode 100644 index 00000000..66e45534 Binary files /dev/null and b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________8_SCALARMAP.png differ diff --git a/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________9_SCALARMAP.png b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________9_SCALARMAP.png new file mode 100644 index 00000000..b1f32f01 Binary files /dev/null and b/test/VisuPrs/ScalarMap/_refs/MODES___DEPL_____________________9_SCALARMAP.png differ diff --git a/test/VisuPrs/Util/paravistest.py b/test/VisuPrs/Util/paravistest.py index 353cd049..0df553cc 100755 --- a/test/VisuPrs/Util/paravistest.py +++ b/test/VisuPrs/Util/paravistest.py @@ -29,6 +29,7 @@ import tempfile import getpass from datetime import date import struct +import sys # Auxiliary variables @@ -352,8 +353,8 @@ def delete_with_inputs(obj): pvsimple.Delete(tmp_obj) def get_png_picture_resolution(infile): - """Returns size (width, height) of the PNG image""" - f = open(infile, 'rb') + """Returns size (width, height) of the PNG image""" + f = open(infile, 'rb') data = f.read(24) f.close() if not (data[:8] == '\211PNG\r\n\032\n'and (data[12:16] == 'IHDR')): @@ -364,8 +365,28 @@ def get_png_picture_resolution(infile): height = int(h) return (width,height) -def save_trace(afile,atrace): - """Saves atrace in afile""" +def save_trace(afile,atrace): + """Saves atrace in afile""" f = open(afile, 'w') f.write(atrace) f.close() + +def compare_view_to_ref_image(view, image_file, threshold=10): + import vtk.test.Testing + # warning: vtkGetTempDir looks at sys.argv contents... + save_sys_argv = sys.argv + sys.argv = [] + vtk.test.Testing.VTK_TEMP_DIR = vtk.util.misc.vtkGetTempDir() + + try: + vtk.test.Testing.compareImage(view.GetRenderWindow(), + image_file, + threshold=threshold) + vtk.test.Testing.interact() + except: + sys.argv = save_sys_argv + print "ERROR!!! Pictures differs from reference image !!!"; + print "Picture: "+image_file + raise + pass + sys.argv = save_sys_argv