Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
- Performance: `--coverage` is about 1.6x to 2.3x faster. Executable-line classification no longer forks `grep` per source line, which was roughly half of a coverage run's wall time and affected both engines equally (#1005)

### Fixed
- Build: the standalone binary size budget is 544 KiB, raised from 500 KiB after ordinary feature growth crossed it; the artifact keeps its indentation rather than being minified (#1045)
- `assert_within_delta` rejects malformed numbers such as `1.2.3` or `5-3` as non-numeric instead of leaking a raw `bc` parse error or silently evaluating them as an expression (#1026)
- Report formats are no longer empty under `--parallel`. `--report-junit`, `--report-tap`, `--report-json`, `--report-html` and `--log-junit` all recorded zero tests, because the rows were collected inside the per-test worker and nothing rebuilt them in the parent (#1004)

Expand Down
18 changes: 16 additions & 2 deletions tests/unit/project/build_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,21 @@ function test_built_binary_contains_no_source_lines() {
assert_equals "0" "$(grep -c '^source ' "$build_dir/bashunit")"
}

function test_built_binary_stays_below_500_kib() {
# The budget is a guard against the artifact growing without anyone noticing,
# not a hard product limit. It was raised from 512000 to 557056 (544 KiB) in
# #1045, after a run of features crossed the old line by 0.3%: the alternatives
# to raising it were both worse.
#
# as-is 518493 bytes over
# strip blank lines 515249 bytes still over — and unsafe, because a blank
# line inside a heredoc is content (#990)
# shfmt --minify 471673 bytes reaches it, by stripping every bit of
# indentation out of the shipped artifact
#
# So: keep the artifact readable and move the line, with headroom for a few more
# features. Raise it deliberately and record the number again when it is hit —
# do not silence it.
function test_built_binary_stays_below_544_kib() {
if ! build_optimizer_is_available; then
bashunit::skip "shfmt and jq are required for standalone optimization"
return
Expand All @@ -334,7 +348,7 @@ function test_built_binary_stays_below_500_kib() {

local bytes
bytes=$(wc -c <"$build_dir/bashunit" | tr -d ' ')
assert_less_or_equal_than 512000 "$bytes"
assert_less_or_equal_than 557056 "$bytes"
}

function test_build_assert_valid_syntax_rejects_broken_file() {
Expand Down
Loading