Skip to content

Move test helper examples to bin targets for build-dir compatibility#113

Merged
basil merged 2 commits intomasterfrom
layout
Mar 12, 2026
Merged

Move test helper examples to bin targets for build-dir compatibility#113
basil merged 2 commits intomasterfrom
layout

Conversation

@basil
Copy link
Owner

@basil basil commented Mar 12, 2026

Cargo's CARGO_BIN_EXE_* env vars (stabilized in 1.94) are only set for [[bin]] targets, not [[example]] targets. Moving test helpers from examples/ to src/bin/ ensures integration tests work correctly with build.build-dir and the upcoming new build-dir layout.

  • Move 17 example files from examples/ to src/bin/
  • Update find_exec() to prefer CARGO_BIN_EXE_ with legacy fallback
  • Exclude test helper binaries from cargo publish via package.exclude

Fixes #112

basil and others added 2 commits March 11, 2026 17:46
Cargo's CARGO_BIN_EXE_* env vars (stabilized in 1.94) are only set for
[[bin]] targets, not [[example]] targets. Moving test helpers from
examples/ to src/bin/ ensures integration tests work correctly with
build.build-dir and the upcoming new build-dir layout.

- Move 17 example files from examples/ to src/bin/
- Update find_exec() to prefer CARGO_BIN_EXE_<name> with legacy fallback
- Exclude test helper binaries from cargo publish via package.exclude

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Distinguishes test helper binaries from the real tool binaries and
allows using a single glob pattern (src/bin/test_*.rs) in
package.exclude. Also updates the pfiles peer name expectation to
account for Linux comm truncation to 15 characters.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@basil basil added the Type: Task A specific piece of work label Mar 12, 2026
@basil basil merged commit 8161006 into master Mar 12, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Type: Task A specific piece of work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How the binary under test is looked up relies on internals of Cargo and will break with existing / upcoming features

1 participant