Skip to content

testing: runtest.py improvements ported from OpenImageIO - #2189

Open
lgritz wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-runtest
Open

lgritz wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-runtest

Conversation

@lgritz

@lgritz lgritz commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

Port the parts of OIIO PR 5465 and 5476 that apply to OSL's runtest.py:

  • run_app() takes a failureok parameter. If the first word of the command names an OSL app (oslc, oslinfo, testshade, testrender, testoptix) or an OIIO app (oiiotool, maketx, etc.), it is replaced with the full path to the built app.
  • New run_commands() takes a multi-line string of shell commands, one per line, and runs each through run_app(). Blank lines and # comments are skipped. So a run.py can list commands exactly as they would be typed, and docs can include them by reference.
  • The oslc, oslinfo, oiiotool, maketx, oiiodiff, testshade, testrender, and testoptix helpers are now thin wrappers around run_app(). oiiotool() also gained failureok and concat parameters.
  • text_diff ignores trailing whitespace differences, which can vary by platform (e.g. cmd.exe's echo).
  • redirect_push and redirect_pop to let a test redirect a portion of output to a different file.

Assisted-by: Claude Code / Claude Opus 5.5

Port the parts of OIIO PR 5465 and 5476 that apply to OSL's
runtest.py:

* run_app() takes a failureok parameter. If the first word of the
  command names an OSL app (oslc, oslinfo, testshade, testrender,
  testoptix) or an OIIO app (oiiotool, maketx, etc.), it is replaced
  with the full path to the built app.
* New run_commands() takes a multi-line string of shell commands, one
  per line, and runs each through run_app(). Blank lines and `#`
  comments are skipped. So a run.py can list commands exactly as they
  would be typed, and docs can include them by reference.
* The oslc, oslinfo, oiiotool, maketx, oiiodiff, testshade, testrender,
  and testoptix helpers are now thin wrappers around run_app().
  oiiotool() also gained failureok and concat parameters.
* text_diff ignores trailing whitespace differences, which can vary by
  platform (e.g. cmd.exe's echo).
* redirect_push and redirect_pop to let a test redirect a portion of
  output to a different file.

Assisted-by: Claude Code / Claude Opus 5.5

Signed-off-by: Larry Gritz <lg@larrygritz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant