-
Notifications
You must be signed in to change notification settings - Fork 48
test: more tests for traps and related options #947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Test Results 3 files 32 suites 15m 15s ⏱️ Results for commit ef6cb69. ♻️ This comment has been updated with latest results. |
Performance Benchmark Report
Code Coverage Report: Only Changed Files listed
Minimum allowed coverage is Test Summary: bash-completion test suite
|
Removed basic extdebug option behavior test cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR significantly expands test coverage for shell traps and related options by adding comprehensive test cases across four test files. The tests document expected bash-compatible behavior for trap handling, with proper annotations for known failures that help track implementation progress.
Changes:
- Added 316 lines of tests for the
functraceoption (set -T) covering DEBUG and RETURN trap inheritance in functions, subshells, and other contexts - Added 318 lines of tests for the
extdebugshell option covering DEBUG trap return value handling, BASH_ARGC/BASH_ARGV arrays, and declare -F behavior - Expanded
errtrace.yamlfrom ~100 to 227 lines with additional tests for ERR trap inheritance in subshells, command substitution, pipelines, and nested functions - Expanded
trap.yamlfrom ~190 to 695 lines with extensive new tests covering trap registration, inheritance patterns across execution contexts, RETURN trap behavior, signal handling, and trap -p edge cases
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| brush-shell/tests/cases/compat/options/functrace.yaml | New file with 26 test cases covering functrace (-T) option behavior including DEBUG/RETURN trap inheritance in functions, subshells, command substitution, pipelines, and selective function tracing with declare -t |
| brush-shell/tests/cases/compat/options/extdebug.yaml | New file with 26 test cases for extdebug option including DEBUG trap return value effects (skip/return commands), BASH_ARGC/BASH_ARGV population, declare -F source info, and interaction with other options |
| brush-shell/tests/cases/compat/options/errtrace.yaml | Expanded with 16 new test cases covering ERR trap inheritance scenarios, reorganized with section comments, renamed one test for clarity, and added comprehensive coverage of pipelines, nested functions, and background jobs |
| brush-shell/tests/cases/compat/builtins/trap.yaml | Massively expanded with 77 new test cases covering trap -l, comprehensive ERR trap scenarios, subshell/command substitution/pipeline/background job trap inheritance, RETURN trap behavior, signal handling, trap reset/clearing, trap -p edge cases, and DEBUG/EXIT trap advanced scenarios |
No description provided.