Skip to content

feat: basic support for trap EXIT#750

Merged
reubeno merged 1 commit into
mainfrom
trap-exit
Nov 9, 2025
Merged

feat: basic support for trap EXIT#750
reubeno merged 1 commit into
mainfrom
trap-exit

Conversation

@reubeno
Copy link
Copy Markdown
Owner

@reubeno reubeno commented Nov 9, 2025

Adds just enough support for basic trap EXIT handlers to get invoked.

The save/restore of last exit status isn't ideal, but gets the test to pass for now. We should consider coming back and looking more seriously at whether there's a more general pattern there.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 9, 2025

Test Results

    3 files     23 suites   6m 18s ⏱️
1 123 tests 1 123 ✅ 0 💤 0 ❌
3 349 runs  3 349 ✅ 0 💤 0 ❌

Results for commit ea54ae6.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 9, 2025

Public API changes for crate: brush-core

Added items

+pub async fn brush_core::Shell::on_exit(&mut self) -> core::result::Result<(), brush_core::error::Error>

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
clone_shell_object 17.44 μs 17.74 μs 0.30 μs 🟠 +1.74%
eval_arithmetic 0.14 μs 0.17 μs 0.02 μs 🟠 +14.58%
expand_one_string 1.67 μs 1.70 μs 0.03 μs ⚪ Unchanged
for_loop 20.92 μs 20.90 μs -0.02 μs ⚪ Unchanged
function_call 2.15 μs 2.20 μs 0.05 μs ⚪ Unchanged
instantiate_shell 57.98 μs 57.93 μs -0.05 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 24385.66 μs 24792.42 μs 406.76 μs 🟠 +1.67%
parse_bash_completion 2024.41 μs 2021.03 μs -3.38 μs ⚪ Unchanged
parse_sample_script 1.93 μs 1.99 μs 0.06 μs ⚪ Unchanged
run_echo_builtin_command 15.50 μs 15.77 μs 0.27 μs ⚪ Unchanged
run_one_external_command 2346.42 μs 2291.00 μs -55.42 μs 🟢 -2.36%
tokenize_sample_script 3.48 μs 3.48 μs 0.01 μs ⚪ Unchanged

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/shell.rs 🟢 75.67% 🟢 76.25% 🟢 0.58%
brush-interactive/src/interactive_shell.rs 🟠 63.49% 🟠 63.78% 🟢 0.29%
Overall Coverage 🟢 71.83% 🟢 71.86% 🟢 0.03%

Minimum allowed coverage is 70%, this run produced 71.86%

Test Summary: bash-completion test suite

Outcome Count Percentage
✅ Pass 1351 64.06
❗️ Error 212 10.05
❌ Fail 177 8.39
⏩ Skip 354 16.79
❎ Expected Fail 14 0.66
✔️ Unexpected Pass 1 0.05
📊 Total 2109 100.00

@reubeno reubeno merged commit 2682cfb into main Nov 9, 2025
42 checks passed
@reubeno reubeno deleted the trap-exit branch November 9, 2025 18:30
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