Skip to content

Conversation

@Chemaclass
Copy link
Member

@Chemaclass Chemaclass commented Jan 15, 2026

📚 Description

Closes #579

Display test output (stdout/stderr) on failure for runtime errors, helping debug test failures without manually capturing output.

When a test fails due to a runtime error (command not found, unbound variable, permission denied, etc.), bashunit now displays the captured output in an "Output:" section.

🔖 Changes

  • Add --show-output CLI option to show test output on failure (enabled by default)
  • Add --no-output-on-failure CLI option to hide test output on failure
  • Add BASHUNIT_SHOW_OUTPUT_ON_FAILURE environment variable for configuration
  • Update print_error_test function to display captured output when enabled
  • Pass runtime output to failure reporting functions
  • Update documentation for command-line and configuration options

✅ To-do list

  • I updated the CHANGELOG.md to reflect the new feature or fix
  • I updated the documentation to reflect the changes

  Show captured stdout/stderr in an "Output:" section when tests fail
  with runtime errors (command not found, unbound variable, etc.).

  - Add BASHUNIT_SHOW_OUTPUT_ON_FAILURE config (default: true)
  - Add --show-output and --no-output-on-failure CLI options
  - Update documentation and changelog
@Chemaclass Chemaclass added the enhancement New feature or request label Jan 15, 2026
@Chemaclass Chemaclass self-assigned this Jan 15, 2026
@Chemaclass Chemaclass force-pushed the feat/579-add-output-to-failing-tests branch from 5f826b0 to d7b93ef Compare January 15, 2026 15:28
@Chemaclass Chemaclass merged commit 147d586 into main Jan 15, 2026
16 checks passed
@Chemaclass Chemaclass deleted the feat/579-add-output-to-failing-tests branch January 15, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add output to failing tests

4 participants