1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-27 15:12:36 +02:00
Hsuan Ting Chen 2638aafdbb flashrom-tester: Include flashrom/src/cmd.rs tests in Cargo workspace
Ensure ChromeOS ebuild (ecargo_test) runs all unit tests, including
those under flashrom/src/cmd.rs which were previously being skipped due
to not being in the default Cargo workspace.

By adding flashrom/ to the [workspace] section of Cargo.toml, these
tests will now be consistently included when building and testing
flashrom-tester on ChromeOS.

References:
* ebuild of flashrom-tester: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/refs/heads/main/sys-apps/flashrom-tester/flashrom-tester-9999.ebuild
* ecarg_test: https://chromium.googlesource.com/chromiumos/overlays/chromiumos-overlay/+/refs/heads/main/eclass/cros-rust.eclass#765

BUG=b:338962302
TEST=(ChromeOS)
     FEATURES=`test emerge-corsola flashrom-tester`
     Could see tests like `cmd::tests::decode_io_opt ... ok`
TEST=(UPSTREAM)
     1. Build flashrom by `meson`
     2. Build bindings/rust/libflashrom by `cargo build`
     3. Build util/flashrom_tester by
     `cargo build`
     `cargo test --workspace`
     Could see tests like `cmd::tests::decode_io_opt ... ok`

Change-Id: Ic23bc35592e6d7d8dd24c71630ea9a2eb2d58573
Signed-off-by: Hsuan Ting Chen <roccochen@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/82231
Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2024-05-12 11:21:18 +00:00

44 lines
1.0 KiB
TOML

[package]
name = "flashrom_tester"
version = "1.6.0"
authors = ["Edward O'Callaghan <quasisec@chromium.org>",
"Peter Marheine <pmarheine@chromium.org>"]
description = "A tool to verify flashrom and flash chip behaviour."
license = "GPL-2.0-only"
edition = "2018"
build = "build.rs"
[lib]
name = "flashrom_tester"
[[bin]]
name = "flashrom_tester"
required-features = ["cli"]
[workspace]
members = [".", "flashrom"]
[dependencies]
atty = "0.2"
built = { version = "0.5", features = ["chrono"] }
chrono = { version = "0.4", optional = true }
clap = { version = "2.33", default-features = false, optional = true }
flashrom = { path = "flashrom/" }
libc = "0.2"
libflashrom = { path = "../../bindings/rust/libflashrom" }
log = { version = "0.4", features = ["std"] }
rand = "0.6.4"
serde_json = "1"
sys-info = "0.9"
[build-dependencies]
built = { version = "0.5", features = ["chrono"] }
[dev-dependencies]
gag = "1"
[features]
# Features required to build the CLI binary but not the library
cli = ["chrono", "clap"]
default = ["cli"]