Files
codex/codex-rs/tui/BUILD.bazel
T
jif 6c839b3694 Separate test-only Rust sources from Bazel library and binary inputs (#57741)
## What changed

Add `unit_test_srcs` to `codex_rust_crate` to exclude test-only modules from library and binary sources while making them available to unit tests through `compile_data`.

Configure `codex-core` and `codex-tui` to use this option for their test modules and support files.

GitOrigin-RevId: 437b5ddb75e66a96f3c5cb9b309cb0e2608ba169
2026-10-28 13:53:43 +00:00

35 lines
1015 B
Python

load("//:defs.bzl", "MACOS_WEBRTC_RUSTC_LINK_FLAGS", "codex_rust_crate")
codex_rust_crate(
name = "tui",
binaries_with_build_commit = ["codex-tui"],
compile_data = glob([
"assets/**",
]),
crate_name = "codex_tui",
extra_binaries = [
"//codex-rs/cli:codex",
],
integration_compile_data_extra = ["src/test_backend.rs"],
rustc_flags_extra = MACOS_WEBRTC_RUSTC_LINK_FLAGS,
test_data_extra = glob([
"src/**/*.rs",
"src/**/snapshots/**",
"tests/fixtures/**",
]),
test_shard_counts = {
"tui-unit-tests": 8,
},
# The startup symlink test applies its own Seatbelt policy, which cannot be nested.
test_tags = ["no-sandbox"],
unit_test_srcs = glob([
"src/**/*_test_support.rs",
"src/**/*_tests.rs",
"src/**/*_tests/**/*.rs",
"src/**/test_fixtures.rs",
"src/**/test_support.rs",
"src/**/tests.rs",
"src/**/tests/**/*.rs",
]) + ["src/test_backend.rs"],
)