From 3e33c474d719046ee9ef20f9bf59ea184e529f40 Mon Sep 17 00:00:00 2001 From: Larry Gritz Date: Sat, 28 Mar 2026 12:18:54 -0700 Subject: [PATCH] testing: speed up exr-decreasingy test This test did more than was really necessary. It resized a small image (twice) to get big images, but the contents didn't matter, so just using a gradient is good enough. Also, we can check results just by using the hash of the image contents, don't need to do extra idiff calls. It's barely noticeable on a regular release build, since the whole test was only a couple seconds on my laptop and maybe 15 seconds on the GH runnners. But for the CI "sanitize" test, this cuts about 30 seconds from this test! Every little bit helps, the sanitize tests are usually the last to complete in a CI run. Signed-off-by: Larry Gritz --- testsuite/openexr-decreasingy/ref/out-alt.txt | 8 +++ testsuite/openexr-decreasingy/ref/out.txt | 60 ++----------------- testsuite/openexr-decreasingy/run.py | 31 ++++------ 3 files changed, 26 insertions(+), 73 deletions(-) create mode 100644 testsuite/openexr-decreasingy/ref/out-alt.txt diff --git a/testsuite/openexr-decreasingy/ref/out-alt.txt b/testsuite/openexr-decreasingy/ref/out-alt.txt new file mode 100644 index 0000000000..2b3b12b12a --- /dev/null +++ b/testsuite/openexr-decreasingy/ref/out-alt.txt @@ -0,0 +1,8 @@ +increasingY.exr : 4080 x 3072, 3 channel, half openexr + SHA-1: F1BB46E882CB2F57C3E5E3546DA421BC65BE2856 +increasingY-copy.exr : 4080 x 3072, 3 channel, half openexr + SHA-1: F1BB46E882CB2F57C3E5E3546DA421BC65BE2856 +decreasingY.exr : 4080 x 3072, 3 channel, half openexr + SHA-1: F1BB46E882CB2F57C3E5E3546DA421BC65BE2856 +decreasingY-copy.exr : 4080 x 3072, 3 channel, half openexr + SHA-1: F1BB46E882CB2F57C3E5E3546DA421BC65BE2856 diff --git a/testsuite/openexr-decreasingy/ref/out.txt b/testsuite/openexr-decreasingy/ref/out.txt index 5e92b1164a..97e3d468aa 100644 --- a/testsuite/openexr-decreasingy/ref/out.txt +++ b/testsuite/openexr-decreasingy/ref/out.txt @@ -1,56 +1,8 @@ -Reading increasingY-resize.exr -increasingY-resize.exr : 4080 x 3072, 3 channel, half openexr - channel list: R, G, B - compression: "zip" - Orientation: 1 (normal) - PixelAspectRatio: 1 - ResolutionUnit: "in" - screenWindowCenter: 0, 0 - screenWindowWidth: 1 - XResolution: 72 - YResolution: 72 - oiio:subimages: 1 - openexr:lineOrder: "increasingY" -Reading increasingY-copy.exr +increasingY.exr : 4080 x 3072, 3 channel, half openexr + SHA-1: 55ECB0DBDCDA7AC0716E402DBB572E6EFAFBCBCB increasingY-copy.exr : 4080 x 3072, 3 channel, half openexr - channel list: R, G, B - compression: "zip" - Orientation: 1 (normal) - PixelAspectRatio: 1 - ResolutionUnit: "in" - screenWindowCenter: 0, 0 - screenWindowWidth: 1 - XResolution: 72 - YResolution: 72 - oiio:subimages: 1 - openexr:lineOrder: "increasingY" -Reading decreasingY-resize.exr -decreasingY-resize.exr : 4080 x 3072, 3 channel, half openexr - channel list: R, G, B - compression: "zip" - Orientation: 1 (normal) - PixelAspectRatio: 1 - ResolutionUnit: "in" - screenWindowCenter: 0, 0 - screenWindowWidth: 1 - XResolution: 72 - YResolution: 72 - oiio:subimages: 1 - openexr:lineOrder: "decreasingY" -Reading decreasingY-copy.exr + SHA-1: 55ECB0DBDCDA7AC0716E402DBB572E6EFAFBCBCB +decreasingY.exr : 4080 x 3072, 3 channel, half openexr + SHA-1: 55ECB0DBDCDA7AC0716E402DBB572E6EFAFBCBCB decreasingY-copy.exr : 4080 x 3072, 3 channel, half openexr - channel list: R, G, B - compression: "zip" - Orientation: 1 (normal) - PixelAspectRatio: 1 - ResolutionUnit: "in" - screenWindowCenter: 0, 0 - screenWindowWidth: 1 - XResolution: 72 - YResolution: 72 - oiio:subimages: 1 - openexr:lineOrder: "decreasingY" -Comparing "increasingY-copy.exr" and "decreasingY-copy.exr" -PASS -Comparing "increasingY-resize.exr" and "decreasingY-resize.exr" -PASS + SHA-1: 55ECB0DBDCDA7AC0716E402DBB572E6EFAFBCBCB diff --git a/testsuite/openexr-decreasingy/run.py b/testsuite/openexr-decreasingy/run.py index db350c9319..d8b567ff20 100644 --- a/testsuite/openexr-decreasingy/run.py +++ b/testsuite/openexr-decreasingy/run.py @@ -14,31 +14,24 @@ redirect = " >> out.txt 2>&1 " # Create reference images stored in increasingY order (default) -# Resizing to a large image size to ensure scanline chunking logic is triggered. -command += oiiotool("../common/tahoe-tiny.tif --resize 4080x3072 -o increasingY-resize.exr") -command += info_command("increasingY-resize.exr", safematch=True, hash=False) -command += oiiotool("increasingY-resize.exr -o increasingY-copy.exr") -command += info_command("increasingY-copy.exr", safematch=True, hash=False) +# Use a large image size to ensure scanline chunking logic is triggered. +command += oiiotool("-pattern:type=half fill:topleft=1,0,0:topright=0,1,0:bottomleft=0,0,1:bottomright=1,1,1 4080x3072 3 -o increasingY.exr") +command += info_command("increasingY.exr", safematch=True, hash=True, verbose=False) +# Just do a straight copy of it via oiiotool, all default operations +command += oiiotool("increasingY.exr -o increasingY-copy.exr") +command += info_command("increasingY-copy.exr", safematch=True, hash=True, verbose=False) -# Create an image in decreasing order via resizing (Tests ImageOutput::write_image() logic) -command += oiiotool("../common/tahoe-tiny.tif --resize 4080x3072 --attrib openexr:lineOrder decreasingY -o decreasingY-resize.exr") -command += info_command("decreasingY-resize.exr", safematch=True, hash=False) +# Create an image in decreasing order (Tests ImageOutput::write_image() logic) +command += oiiotool("-pattern:type=half fill:topleft=1,0,0:topright=0,1,0:bottomleft=0,0,1:bottomright=1,1,1 4080x3072 3 --attrib openexr:lineOrder decreasingY -o decreasingY.exr") +command += info_command("decreasingY.exr", safematch=True, hash=True, verbose=False) # Create an image in decreasing order via copying a reference image. (Tests ImageBuf::write() logic) -command += oiiotool("decreasingY-resize.exr --attrib openexr:lineOrder decreasingY -o decreasingY-copy.exr") -command += info_command("decreasingY-copy.exr", safematch=True, hash=False) +command += oiiotool("decreasingY.exr --attrib openexr:lineOrder decreasingY -o decreasingY-copy.exr") +command += info_command("decreasingY-copy.exr", safematch=True, hash=True, verbose=False) -# They should match -command += diff_command("increasingY-copy.exr", "decreasingY-copy.exr") -command += diff_command("increasingY-resize.exr", "decreasingY-resize.exr") +# The hashes should all match! # Outputs to check against references. -# This makes sure the images look the same since the line order is a storage detail and should not -# change how the image actually looks. These comparisons help verify chunk order and scanlines are -# processed properly. outputs = [ "out.txt" ] - - -#print "Running this command:\n" + command + "\n"