Loading
buildRustCrate: name tests/<dir>/main.rs binaries as <dir> to match cargo
build_bin_test_file derives the test binary name by replacing `/` with `_`, stripping the `tests_` prefix and `.rs` suffix. For the subdirectory integration-test layout `tests/<dir>/main.rs`, this produces `<dir>_main`, but cargo names that binary `<dir>` per its auto-discovery rules. Tools that expect the cargo convention (cargo-nextest binaries-metadata, IDE test runners) cannot find the binaries. Strip the trailing `_main` when the source file is `*/main.rs`. The guard is needed so a flat-style `tests/<name>_main.rs` keeps its suffix. Add `expectedTestBinaries` to the test harness so binary naming can be asserted, and cover both the subdir case (suffix stripped) and the flat case with a literal `_main` in the filename (suffix kept). Also fix a typo in `removeAttrs` that leaked `expectedTestOutputs` into the crate args.