Skip to content

Report stdout/stderr errors gracefully #125

Description

@mjambon

Test functions should not close stdout or stderr since these are managed by testo. For example, the test function (fun () -> close_out stdout) results in an uncaught exception when or after running the test:

test: internal error, uncaught exception:
      Sys_error("Bad file descriptor")
      Raised by primitive operation at CamlinternalFormat.output_acc in file "camlinternalFormat.ml", line 1908, characters 48-63
...

I don't think we can prevent user code from accidentally closing stdout or stderr but maybe we can help the user fix their test function:

  1. Catch exceptions when calling flush, close, etc.
  2. Explain that there's either a bug in testo or that a specific test closed stdout or stderr.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions