Skip to content

Commit

Permalink
test: Shuffle some tests between directories (#4091)
Browse files Browse the repository at this point in the history
Move a bunch of specific tests from testsuite/oiiotool to
testsuite/oiiotool-copy to group similar tests together, and also to
load balance better between the tests.

Signed-off-by: Larry Gritz <[email protected]>
  • Loading branch information
lgritz committed Jan 1, 2024
1 parent 56061c0 commit 0fde420
Show file tree
Hide file tree
Showing 20 changed files with 112 additions and 108 deletions.
Binary file added testsuite/oiiotool-copy/ref/allhalf.exr
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
53 changes: 53 additions & 0 deletions testsuite/oiiotool-copy/ref/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@ WARNING: --ch: Unknown channel name "Z", filling with 0 (actual channels: "R,G,B
WARNING: --ch: Unknown channel name "R", filling with 0 (actual channels: "Z")
WARNING: --ch: Unknown channel name "G", filling with 0 (actual channels: "Z")
WARNING: --ch: Unknown channel name "B", filling with 0 (actual channels: "Z")
Reading allhalf.exr
allhalf.exr : 38 x 38, 5 channel, half openexr
SHA-1: 1C71682E8D8F6DCDC2A7A7B23842DFEEC51438F2
channel list: R, G, B, A, Z
full/display size: 40 x 40
full/display origin: 0, 0
compression: "zips"
Orientation: 1 (normal)
PixelAspectRatio: 1
screenWindowCenter: 0, 0
screenWindowWidth: 1
oiio:ColorSpace: "Linear"
oiio:subimages: 1
Reading rgbahalf-zfloat.exr
rgbahalf-zfloat.exr : 38 x 38, 5 channel, half/half/half/half/float openexr
SHA-1: 9324AFD44451321A8D87E09F656C7B86E827E5CD
channel list: R (half), G (half), B (half), A (half), Z (float)
full/display size: 40 x 40
full/display origin: 0, 0
compression: "zips"
Orientation: 1 (normal)
PixelAspectRatio: 1
screenWindowCenter: 0, 0
screenWindowWidth: 1
oiio:ColorSpace: "Linear"
oiio:subimages: 1
explicit -d uint save result:
uint8.tif : 128 x 128, 3 channel, uint8 tiff
tile size: 16 x 16
Expand Down Expand Up @@ -29,6 +55,19 @@ tmp.tif : 128 x 128, 3 channel, uint8 tiff
tile size: 16 x 16

oiiotool WARNING: -o : Can't save 4 channels to png... saving only channels R,G,B
Reading chname.exr
chname.exr : 38 x 38, 5 channel, float openexr
SHA-1: 6EB25E53358BF3ECDFECD04F662D335DE647A1A6
channel list: Red, G, B, A, Depth
full/display size: 40 x 40
full/display origin: 0, 0
compression: "zips"
Orientation: 1 (normal)
PixelAspectRatio: 1
screenWindowCenter: 0, 0
screenWindowWidth: 1
oiio:ColorSpace: "Linear"
oiio:subimages: 1
Reading green.exr
green.exr : 64 x 64, 3 channel, half openexr
SHA-1: 8B61993247469F3C208CA894D71856727B11606A
Expand Down Expand Up @@ -83,6 +122,20 @@ Comparing "ch-err.exr" and "ref/ch-err.exr"
PASS
Comparing "ch-err2.exr" and "ref/ch-err2.exr"
PASS
Comparing "allhalf.exr" and "ref/allhalf.exr"
PASS
Comparing "rgbahalf-zfloat.exr" and "ref/rgbahalf-zfloat.exr"
PASS
Comparing "chanshuffle.tif" and "ref/chanshuffle.tif"
PASS
Comparing "ch-rgba.exr" and "ref/ch-rgba.exr"
PASS
Comparing "ch-z.exr" and "ref/ch-z.exr"
PASS
Comparing "chappend-rgbaz.exr" and "ref/chappend-rgbaz.exr"
PASS
Comparing "chname.exr" and "ref/chname.exr"
PASS
Comparing "crop.tif" and "ref/crop.tif"
PASS
Comparing "cut.tif" and "ref/cut.tif"
Expand Down
File renamed without changes.
29 changes: 29 additions & 0 deletions testsuite/oiiotool-copy/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,16 @@
command += oiiotool("-i:ch=R,G,B rgb-z-parts64.exr -d half -o ch-err2.exr")


# test -d to change data formats
command += oiiotool ("src/rgbaz.exr -d half -o allhalf.exr")
command += info_command ("allhalf.exr", safematch=1)

# test -d NAME=fmt to change data format of one channel, and to make
# sure oiiotool will output per-channel formats.
command += oiiotool ("src/rgbaz.exr -d half -d Z=float -o rgbahalf-zfloat.exr")
command += info_command ("rgbahalf-zfloat.exr", safematch=1)


# Some tests to verify that we are transferring data formats properly.
#
command += oiiotool ("-pattern checker 128x128 3 -d uint8 -tile 16 16 -o uint8.tif " +
Expand Down Expand Up @@ -56,6 +66,22 @@
# a warning message about only saving the first 3 channels.
command += oiiotool ("--pattern constant:color=0.1,0.2,0.3,0.4 64x64 4 --chnames R,G,B,X -d uint8 -o rgbx.png")


# test channel shuffling
command += oiiotool ("../common/grid.tif"
+ " --ch =0.25,B,G -o chanshuffle.tif")

# test --ch to separate RGBA from an RGBAZ file
command += oiiotool ("src/rgbaz.exr --ch R,G,B,A -o ch-rgba.exr")
command += oiiotool ("src/rgbaz.exr --ch Z -o ch-z.exr")

# test --chappend to merge RGBA and Z
command += oiiotool ("ch-rgba.exr ch-z.exr --chappend -o chappend-rgbaz.exr")

# test --chnames to rename channels
command += oiiotool ("src/rgbaz.exr --chnames Red,,,,Depth -o chname.exr")
command += info_command ("chname.exr", safematch=1)

# test --crop
command += oiiotool ("../common/grid.tif --crop 100x400+50+200 -o crop.tif")

Expand Down Expand Up @@ -109,6 +135,9 @@
# Outputs to check against references
outputs = [
"rgonly.exr", "ch-err.exr", "ch-err2.exr",
"allhalf.exr", "rgbahalf-zfloat.exr",
"chanshuffle.tif", "ch-rgba.exr", "ch-z.exr",
"chappend-rgbaz.exr", "chname.exr",
"crop.tif", "cut.tif", "pasted.tif",
"mosaic.tif", "mosaicfit.tif",
"greenmeta.exr",
Expand Down
File renamed without changes.
51 changes: 0 additions & 51 deletions testsuite/oiiotool/ref/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,45 +4,6 @@
0 < 0,0,0
6400 > 1,0.9,1
59136 within range
Reading chname.exr
chname.exr : 38 x 38, 5 channel, float openexr
SHA-1: 6EB25E53358BF3ECDFECD04F662D335DE647A1A6
channel list: Red, G, B, A, Depth
full/display size: 40 x 40
full/display origin: 0, 0
compression: "zips"
Orientation: 1 (normal)
PixelAspectRatio: 1
screenWindowCenter: 0, 0
screenWindowWidth: 1
oiio:ColorSpace: "Linear"
oiio:subimages: 1
Reading allhalf.exr
allhalf.exr : 38 x 38, 5 channel, half openexr
SHA-1: 1C71682E8D8F6DCDC2A7A7B23842DFEEC51438F2
channel list: R, G, B, A, Z
full/display size: 40 x 40
full/display origin: 0, 0
compression: "zips"
Orientation: 1 (normal)
PixelAspectRatio: 1
screenWindowCenter: 0, 0
screenWindowWidth: 1
oiio:ColorSpace: "Linear"
oiio:subimages: 1
Reading rgbahalf-zfloat.exr
rgbahalf-zfloat.exr : 38 x 38, 5 channel, half/half/half/half/float openexr
SHA-1: 9324AFD44451321A8D87E09F656C7B86E827E5CD
channel list: R (half), G (half), B (half), A (half), Z (float)
full/display size: 40 x 40
full/display origin: 0, 0
compression: "zips"
Orientation: 1 (normal)
PixelAspectRatio: 1
screenWindowCenter: 0, 0
screenWindowWidth: 1
oiio:ColorSpace: "Linear"
oiio:subimages: 1
--printstats:
128 x 96, 3 channel, float tiff
Stats Min: 0 0 0 (of 255)
Expand Down Expand Up @@ -100,16 +61,6 @@ Comparing "trim.tif" and "ref/trim.tif"
PASS
Comparing "trimsubimages.tif" and "ref/trimsubimages.tif"
PASS
Comparing "chanshuffle.tif" and "ref/chanshuffle.tif"
PASS
Comparing "ch-rgba.exr" and "ref/ch-rgba.exr"
PASS
Comparing "ch-z.exr" and "ref/ch-z.exr"
PASS
Comparing "chappend-rgbaz.exr" and "ref/chappend-rgbaz.exr"
PASS
Comparing "chname.exr" and "ref/chname.exr"
PASS
Comparing "add.exr" and "ref/add.exr"
PASS
Comparing "cadd1.exr" and "ref/cadd1.exr"
Expand Down Expand Up @@ -158,8 +109,6 @@ Comparing "absdiffc.exr" and "ref/absdiffc.exr"
PASS
Comparing "chsum.tif" and "ref/chsum.tif"
PASS
Comparing "rgbahalf-zfloat.exr" and "ref/rgbahalf-zfloat.exr"
PASS
Comparing "tahoe-filled.tif" and "ref/tahoe-filled.tif"
PASS
Comparing "growholes.tif" and "ref/growholes.tif"
Expand Down
27 changes: 0 additions & 27 deletions testsuite/oiiotool/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,30 +100,6 @@
+ "--create 320x240 3 -fill:color=.5,.5,.1 100x10+70+70 -rotate 140 "
+ "--siappend -trim -origin +0+0 -fullpixels -d uint8 -o trimsubimages.tif")

# test channel shuffling
command += oiiotool ("../common/grid.tif"
+ " --ch =0.25,B,G -o chanshuffle.tif")

# test --ch to separate RGBA from an RGBAZ file
command += oiiotool ("src/rgbaz.exr --ch R,G,B,A -o ch-rgba.exr")
command += oiiotool ("src/rgbaz.exr --ch Z -o ch-z.exr")

# test --chappend to merge RGBA and Z
command += oiiotool ("ch-rgba.exr ch-z.exr --chappend -o chappend-rgbaz.exr")

# test --chnames to rename channels
command += oiiotool ("src/rgbaz.exr --chnames Red,,,,Depth -o chname.exr")
command += info_command ("chname.exr", safematch=1)

# test -d to change data formats
command += oiiotool ("src/rgbaz.exr -d half -o allhalf.exr")
command += info_command ("allhalf.exr", safematch=1)

# test -d NAME=fmt to change data format of one channel, and to make
# sure oiiotool will output per-channel formats.
command += oiiotool ("src/rgbaz.exr -d half -d Z=float -o rgbahalf-zfloat.exr")
command += info_command ("rgbahalf-zfloat.exr", safematch=1)

# test hole filling
command += oiiotool ("ref/hole.tif --fillholes -o tahoe-filled.tif")
# test hole filling for a cropped image
Expand Down Expand Up @@ -263,8 +239,6 @@
"filled.tif",
"autotrim.tif",
"trim.tif", "trimsubimages.tif",
"chanshuffle.tif", "ch-rgba.exr", "ch-z.exr",
"chappend-rgbaz.exr", "chname.exr",
"add.exr", "cadd1.exr", "cadd2.exr",
"sub.exr", "subc.exr",
"mul.exr", "cmul1.exr", "cmul2.exr",
Expand All @@ -275,7 +249,6 @@
"normalize_offsetscaleout.exr", "normalize_offsetscale.exr",
"abs.exr", "absdiff.exr", "absdiffc.exr",
"chsum.tif",
"rgbahalf-zfloat.exr",
"tahoe-filled.tif", "growholes.tif",
"rangecompress.tif", "rangeexpand.tif",
"rangecompress-luma.tif", "rangeexpand-luma.tif",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ Comparing "noise-blue3.tif" and "ref/noise-blue3.tif"
PASS
Comparing "bluenoise_image3.tif" and "ref/bluenoise_image3.tif"
PASS
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool/ref/chanshuffle.tif"
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool-copy/ref/chanshuffle.tif"
PASS
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool/ref/ch-rgba.exr"
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool-copy/ref/ch-rgba.exr"
PASS
Comparing "ch-z.exr" and "../../../testsuite/oiiotool/ref/ch-z.exr"
Comparing "ch-z.exr" and "../../../testsuite/oiiotool-copy/ref/ch-z.exr"
PASS
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool/ref/chappend-rgbaz.exr"
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool-copy/ref/chappend-rgbaz.exr"
PASS
Comparing "flat.exr" and "../../../testsuite/oiiotool-deep/ref/flat.exr"
PASS
Expand Down
8 changes: 4 additions & 4 deletions testsuite/python-imagebufalgo/ref/out-freetype2.4.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ Comparing "noise-blue3.tif" and "ref/noise-blue3.tif"
PASS
Comparing "bluenoise_image3.tif" and "ref/bluenoise_image3.tif"
PASS
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool/ref/chanshuffle.tif"
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool-copy/ref/chanshuffle.tif"
PASS
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool/ref/ch-rgba.exr"
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool-copy/ref/ch-rgba.exr"
PASS
Comparing "ch-z.exr" and "../../../testsuite/oiiotool/ref/ch-z.exr"
Comparing "ch-z.exr" and "../../../testsuite/oiiotool-copy/ref/ch-z.exr"
PASS
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool/ref/chappend-rgbaz.exr"
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool-copy/ref/chappend-rgbaz.exr"
PASS
Comparing "flat.exr" and "../../../testsuite/oiiotool-deep/ref/flat.exr"
PASS
Expand Down
8 changes: 4 additions & 4 deletions testsuite/python-imagebufalgo/ref/out-macarm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ Comparing "noise-blue3.tif" and "ref/noise-blue3.tif"
PASS
Comparing "bluenoise_image3.tif" and "ref/bluenoise_image3.tif"
PASS
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool/ref/chanshuffle.tif"
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool-copy/ref/chanshuffle.tif"
PASS
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool/ref/ch-rgba.exr"
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool-copy/ref/ch-rgba.exr"
PASS
Comparing "ch-z.exr" and "../../../testsuite/oiiotool/ref/ch-z.exr"
Comparing "ch-z.exr" and "../../../testsuite/oiiotool-copy/ref/ch-z.exr"
PASS
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool/ref/chappend-rgbaz.exr"
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool-copy/ref/chappend-rgbaz.exr"
PASS
Comparing "flat.exr" and "../../../testsuite/oiiotool-deep/ref/flat.exr"
PASS
Expand Down
8 changes: 4 additions & 4 deletions testsuite/python-imagebufalgo/ref/out-python2-alt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ Comparing "noise-blue3.tif" and "ref/noise-blue3.tif"
PASS
Comparing "bluenoise_image3.tif" and "ref/bluenoise_image3.tif"
PASS
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool/ref/chanshuffle.tif"
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool-copy/ref/chanshuffle.tif"
PASS
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool/ref/ch-rgba.exr"
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool-copy/ref/ch-rgba.exr"
PASS
Comparing "ch-z.exr" and "../../../testsuite/oiiotool/ref/ch-z.exr"
Comparing "ch-z.exr" and "../../../testsuite/oiiotool-copy/ref/ch-z.exr"
PASS
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool/ref/chappend-rgbaz.exr"
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool-copy/ref/chappend-rgbaz.exr"
PASS
Comparing "flat.exr" and "../../../testsuite/oiiotool-deep/ref/flat.exr"
PASS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ Comparing "noise-blue3.tif" and "ref/noise-blue3.tif"
PASS
Comparing "bluenoise_image3.tif" and "ref/bluenoise_image3.tif"
PASS
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool/ref/chanshuffle.tif"
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool-copy/ref/chanshuffle.tif"
PASS
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool/ref/ch-rgba.exr"
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool-copy/ref/ch-rgba.exr"
PASS
Comparing "ch-z.exr" and "../../../testsuite/oiiotool/ref/ch-z.exr"
Comparing "ch-z.exr" and "../../../testsuite/oiiotool-copy/ref/ch-z.exr"
PASS
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool/ref/chappend-rgbaz.exr"
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool-copy/ref/chappend-rgbaz.exr"
PASS
Comparing "flat.exr" and "../../../testsuite/oiiotool-deep/ref/flat.exr"
PASS
Expand Down
8 changes: 4 additions & 4 deletions testsuite/python-imagebufalgo/ref/out-python3.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ Comparing "noise-blue3.tif" and "ref/noise-blue3.tif"
PASS
Comparing "bluenoise_image3.tif" and "ref/bluenoise_image3.tif"
PASS
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool/ref/chanshuffle.tif"
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool-copy/ref/chanshuffle.tif"
PASS
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool/ref/ch-rgba.exr"
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool-copy/ref/ch-rgba.exr"
PASS
Comparing "ch-z.exr" and "../../../testsuite/oiiotool/ref/ch-z.exr"
Comparing "ch-z.exr" and "../../../testsuite/oiiotool-copy/ref/ch-z.exr"
PASS
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool/ref/chappend-rgbaz.exr"
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool-copy/ref/chappend-rgbaz.exr"
PASS
Comparing "flat.exr" and "../../../testsuite/oiiotool-deep/ref/flat.exr"
PASS
Expand Down
8 changes: 4 additions & 4 deletions testsuite/python-imagebufalgo/ref/out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ Comparing "noise-blue3.tif" and "ref/noise-blue3.tif"
PASS
Comparing "bluenoise_image3.tif" and "ref/bluenoise_image3.tif"
PASS
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool/ref/chanshuffle.tif"
Comparing "chanshuffle.tif" and "../../../testsuite/oiiotool-copy/ref/chanshuffle.tif"
PASS
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool/ref/ch-rgba.exr"
Comparing "ch-rgba.exr" and "../../../testsuite/oiiotool-copy/ref/ch-rgba.exr"
PASS
Comparing "ch-z.exr" and "../../../testsuite/oiiotool/ref/ch-z.exr"
Comparing "ch-z.exr" and "../../../testsuite/oiiotool-copy/ref/ch-z.exr"
PASS
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool/ref/chappend-rgbaz.exr"
Comparing "chappend-rgbaz.exr" and "../../../testsuite/oiiotool-copy/ref/chappend-rgbaz.exr"
PASS
Comparing "flat.exr" and "../../../testsuite/oiiotool-deep/ref/flat.exr"
PASS
Expand Down
4 changes: 2 additions & 2 deletions testsuite/python-imagebufalgo/src/test_imagebufalgo.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,10 @@ def test_iba (func, *args, **kwargs) :
# channels, channel_append
b = ImageBufAlgo.channels (grid, (0.25,2,"G"))
write (b, "chanshuffle.tif")
b = ImageBufAlgo.channels (ImageBuf(OIIO_TESTSUITE_ROOT+"/oiiotool/src/rgbaz.exr"),
b = ImageBufAlgo.channels (ImageBuf(OIIO_TESTSUITE_ROOT+"/oiiotool-copy/src/rgbaz.exr"),
("R","G","B","A"))
write (b, "ch-rgba.exr")
b = ImageBufAlgo.channels (ImageBuf(OIIO_TESTSUITE_ROOT+"/oiiotool/src/rgbaz.exr"), ("Z",))
b = ImageBufAlgo.channels (ImageBuf(OIIO_TESTSUITE_ROOT+"/oiiotool-copy/src/rgbaz.exr"), ("Z",))
write (b, "ch-z.exr")
b = test_iba (ImageBufAlgo.channel_append, ImageBuf("ch-rgba.exr"),
ImageBuf("ch-z.exr"))
Expand Down

0 comments on commit 0fde420

Please sign in to comment.