mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
tests: enable cargo test --workspace + #[cfg(devcli_testenv)]
TL;DR: Massive quality of life improvement for devs Cloud Hypervisor uses the Cargo test framework for multiple tests: - normal unit tests - unit tests requiring special environment (the Tap device tests) - integration tests requiring a special environment This prevented the execution of `cargo test --workspace`, which results in a very poor developer experience. Although `./scripts/run_unit_tests.sh` exists, there are valid reasons why devs cannot or even don't want to use it. By adding a new `chv_testenv` rustc config, we can conditionally only activate tests when the `./scripts/` magic runs them. This improves the general developer experience by a lot. Signed-off-by: Philipp Schuster <philipp.schuster@cyberus-technology.de> On-behalf-of: SAP philipp.schuster@sap.com
This commit is contained in:
committed by
Bo Chen
parent
e3e9e1c84c
commit
c990f1bdaa
@@ -549,6 +549,7 @@ impl AsRawFd for Tap {
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[cfg(devcli_testenv)] // we need special permissions in the ENV to create Tap devices
|
||||
mod tests {
|
||||
use std::net::Ipv4Addr;
|
||||
use std::sync::{LazyLock, Mutex, mpsc};
|
||||
|
||||
Reference in New Issue
Block a user