Skip to content

Commit

Permalink
Generate test files with same names as baselines and fix test.
Browse files Browse the repository at this point in the history
  • Loading branch information
danlipsa committed Dec 6, 2016
1 parent 25a3e66 commit bf17786
Show file tree
Hide file tree
Showing 25 changed files with 48 additions and 36 deletions.
2 changes: 1 addition & 1 deletion testing/dv3d/TestManager.py
Expand Up @@ -124,7 +124,7 @@ def interact(self):
def test( self, interactive=False ):
self.build()
# test_image = os.path.join( self.test_dir, 'images', '.'.join( [ self.name, 'png' ] ) )
test_image = '.'.join( [ self.name, 'test', 'png' ] )
test_image = '.'.join( [ self.name, 'png' ] )
self.canvas.png( test_image, width = 900, height = 600 )

ret = regression.check_result_image( test_image, self.image_name,\
Expand Down
2 changes: 1 addition & 1 deletion testing/vcs/test_vcs_1D_with_manyDs.py
Expand Up @@ -6,4 +6,4 @@
d = numpy.reshape(d,(10,10))
one = x.create1d()
x.plot(d,one,bg=1)
regression.run(x, "test_1D_with_manyDs.png", sys.argv[1])
regression.run(x, "test_vcs_1D_with_manyDs.png", sys.argv[1])
2 changes: 1 addition & 1 deletion testing/vcs/test_vcs_1d_in_boxfill.py
Expand Up @@ -5,4 +5,4 @@
d = numpy.sin(numpy.arange(100))
b = x.createboxfill()
x.plot(d,b,bg=1)
regression.run(x, "test_1d_in_boxfill.png", sys.argv[1])
regression.run(x, "test_vcs_1d_in_boxfill.png", sys.argv[1])
3 changes: 2 additions & 1 deletion testing/vcs/test_vcs_1d_marker_not_shown_if_xaxis_flipped.py
Expand Up @@ -12,4 +12,5 @@
gm.datawc_x2=0
gm.markersize=30
x.plot(data,gm,bg=1)
regression.run(x, "test_1d_marker_not_shown_if_xaxis_flipped.png", sys.argv[1])
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm, sys.argv[1])
3 changes: 2 additions & 1 deletion testing/vcs/test_vcs_box_custom_as_def_vistrails_exts.py
Expand Up @@ -9,4 +9,5 @@
gm.ext_1 = "y"
gm.ext_2 = "y"
x.plot(s, gm, bg=1)
regression.run(x, "test_box_custom_as_def_vistrails_exts.png", sys.argv[1])
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm, sys.argv[1])
3 changes: 2 additions & 1 deletion testing/vcs/test_vcs_boxfill_custom.py
Expand Up @@ -19,4 +19,5 @@

# Load the image testing module:
# Create the test image and compare:
regression.run(canvas, "test_boxfill_custom.png")
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(canvas, fnm)
4 changes: 2 additions & 2 deletions testing/vcs/test_vcs_boxfill_custom_ext1.py
Expand Up @@ -20,6 +20,6 @@
boxfill.fillareacolors=vcs.getcolors(boxfill.levels)

canvas.plot(clt, boxfill, bg=1)

fnm = os.path.split(__file__)[1][:-3] + ".png"
# Load the image testing module:
regression.run(canvas, "test_boxfill_custom_ext1.png")
regression.run(canvas, fnm)
4 changes: 2 additions & 2 deletions testing/vcs/test_vcs_boxfill_custom_ext1_ext2.py
Expand Up @@ -21,6 +21,6 @@
boxfill.fillareacolors=vcs.getcolors(boxfill.levels)

canvas.plot(clt, boxfill, bg=1)

fnm = os.path.split(__file__)[1][:-3] + ".png"
# Load the image testing module:
regression.run(canvas, "test_boxfill_custom_ext1_ext2.png")
regression.run(canvas, fnm)
4 changes: 2 additions & 2 deletions testing/vcs/test_vcs_boxfill_custom_ext2.py
Expand Up @@ -25,5 +25,5 @@
boxfill.fillareacolors=vcs.getcolors(boxfill.levels)

canvas.plot(clt, boxfill, bg=1)

regression.run(canvas, "test_boxfill_custom_ext2.png")
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(canvas, fnm)
3 changes: 2 additions & 1 deletion testing/vcs/test_vcs_boxfill_custom_non_default_levels.py
Expand Up @@ -19,4 +19,5 @@
boxfill.fillareacolors=vcs.getcolors(levels)

canvas.plot(clt, boxfill, bg=1)
regression.run(canvas, "test_boxfill_custom_no_default_levels.png")
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(canvas, fnm)
3 changes: 2 additions & 1 deletion testing/vcs/test_vcs_boxfill_decreasing_latitude.py
Expand Up @@ -52,4 +52,5 @@
gm.datawc_y1 = 90

x.plot(ice, gm, tmpl, bg=1)
regression.run(x, "test_boxfill_decreasing_latitude.png")
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm)
3 changes: 2 additions & 1 deletion testing/vcs/test_vcs_boxfill_lev1_lev2_ext1.py
Expand Up @@ -8,4 +8,5 @@
b.level_2 = 80
b.ext_1 = "y"
x.plot(s, b, bg=1)
regression.run(x, "test_boxfill_lev1_lev2_ext1.png")
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm)
3 changes: 2 additions & 1 deletion testing/vcs/test_vcs_boxfill_lev1_lev2_ext1_ext2.py
Expand Up @@ -9,4 +9,5 @@
b.ext_1 = "y"
b.ext_2 = "y"
x.plot(s, b, bg=1)
regression.run(x, "test_boxfill_lev1_lev2_ext1_ext2.png")
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm)
3 changes: 2 additions & 1 deletion testing/vcs/test_vcs_boxfill_lev1_lev2_ext2.py
Expand Up @@ -8,4 +8,5 @@
b.level_2 = 80
b.ext_2 = "y"
x.plot(s, b, bg=1)
regression.run(x, "test_boxfill_lev1_lev2_ext2.png")
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm)
3 changes: 2 additions & 1 deletion testing/vcs/test_vcs_boxfill_lev1_lev2_ta_missing.py
Expand Up @@ -8,4 +8,5 @@
b.level_1 = -40
b.level_2 = 40
x.plot(s, b, bg=1)
regression.run(x, "test_boxfill_lev1_lev2_ta_missing.png")
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm)
4 changes: 2 additions & 2 deletions testing/vcs/test_vcs_infinity.py
Expand Up @@ -12,5 +12,5 @@
x.drawlogooff()
x.setbgoutputdimensions(1200,1091,units="pixels")
x.plot(s,bg=1)
fnm = "infinity.png"
regression.run(x, fnm)
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm)
2 changes: 1 addition & 1 deletion testing/vcs/test_vcs_iso_celine_part1.py
Expand Up @@ -10,5 +10,5 @@
x.scriptrun(os.path.join(pth0,"celine.json"))
i = x.getisofill("celine")
x.plot(s,i,bg=1)
fnm = "test_celine_iso.png"
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm)
2 changes: 1 addition & 1 deletion testing/vcs/test_vcs_iso_celine_part2.py
Expand Up @@ -14,5 +14,5 @@
b.fillareacolors=i.fillareacolors
b.boxfill_type="custom"
x.plot(s,b,bg=1)
fnm = "test_celine_iso_2.png"
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm)
3 changes: 2 additions & 1 deletion testing/vcs/test_vcs_lon_axes_freak_out.py
Expand Up @@ -8,4 +8,5 @@
x.plot(s,bg=1)
x.clear()
x.plot(s3,bg=1)
regression.run(x, "test_lon_axes_freak_out.png")
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm)
3 changes: 2 additions & 1 deletion testing/vcs/test_vcs_matplotlib_colormap.py
Expand Up @@ -15,4 +15,5 @@
canvas = regression.init()
canvas.setcolormap(vcs.matplotlib2vcs("viridis"))
canvas.plot(clt, bg=1)
regression.run(canvas, "test_matplotlib_colormap.png")
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(canvas, fnm)
4 changes: 2 additions & 2 deletions testing/vcs/test_vcs_oned_level_axis.py
Expand Up @@ -5,5 +5,5 @@
ta = cdutil.averager(ta,axis="yx")
x = regression.init()
x.plot(ta,bg=1)
fnm = "test_oned_level_axis.png"
regression.run(x, fnm)
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm)
3 changes: 2 additions & 1 deletion testing/vcs/test_vcs_plot_unstructured_via_boxfill.py
Expand Up @@ -4,4 +4,5 @@
s = f("sample")
x = regression.init()
x.plot(s,bg=1)
regression.run(x, "test_plot_unstructured_via_boxfill.png")
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm)
4 changes: 2 additions & 2 deletions testing/vcs/test_vcs_remove_marker_none_1d.py
Expand Up @@ -11,5 +11,5 @@

gm.marker = None
x.plot(gm, dummy_data,bg=1)
fnm = "test_remove_marker_none_1d.png"
regression.run(x, fnm)
fnm = "test_vcs_remove_marker_none_1d.png"
regression.run(x, fnm)
12 changes: 6 additions & 6 deletions testing/vcs/vtk_ui/test_vtk_ui_text_dimensions.py
Expand Up @@ -16,20 +16,20 @@ def do_test(self):

w, h = vcs.vtk_ui.text.text_dimensions("no descenders", text_property,
dpi)
if w != 175 or h != 24:
print "no descenders width/height changed"
if w != 174 or h != 23:
print "no descenders width/height changed (%d,%d)"%(w,h)
return

w, h = vcs.vtk_ui.text.text_dimensions("couple good descenders",
text_property, dpi)
if w != 299 or h != 24:
print "couple good descenders width/height changed"
if w != 298 or h != 23:
print "couple good descenders width/height changed (%d, %d)"%(w,h)
return

w, h = vcs.vtk_ui.text.text_dimensions(
"This one\nis on\nmultiple lines", text_property, dpi)
if w != 151 or h != 76:
print "Multi-line width/height changed"
if w != 150 or h != 73:
print "Multi-line width/height changed (%d,%d)"%(w,h)
return

self.passed = 0
Expand Down
2 changes: 1 addition & 1 deletion testing/vcsaddons/test_12_plot_one_leg_per_row_right.py
Expand Up @@ -2,7 +2,7 @@

import vcs
from vcsaddons import EzTemplate
import cdms,vcs,sys
import cdms2,vcs,sys
## 12 plots 1 legend per row on the right
## Initialize VCS
x = vcs.init()
Expand Down

0 comments on commit bf17786

Please sign in to comment.