[−][src]Struct escargot::CargoTest
The test
subcommand (emulated).
Created via CargoBuild::run_tests
.
Benefits over spawning cargo test
:
- Able to cache binary path, avoiding cargo overhead.
- Independent of CWD.
- stdout/stderr are clean of
cargo test
output.
Required feature: test_unstable
since the format parsed is unstable.
Relevant features
print
for logged output to be printed instead, generally for test writing.
Example
extern crate escargot; extern crate assert_fs; let temp = assert_fs::TempDir::new().unwrap(); let run = escargot::CargoBuild::new() .test("test") .manifest_path("tests/fixtures/test/Cargo.toml") .target_dir(temp.path()) .run_tests().unwrap() .next().unwrap().unwrap(); println!("artifact={}", run.path().display());
Methods
impl CargoTest
[src]
pub fn path(&self) -> &Path
[src]
Path to the specified binary.
This is to support alternative ways of launching the binary besides Command
.
Example
extern crate escargot; extern crate assert_fs; let temp = assert_fs::TempDir::new().unwrap(); let run: Vec<_> = escargot::CargoBuild::new() .tests() .current_release() .current_target() .manifest_path("tests/fixtures/test/Cargo.toml") .target_dir(temp.path()) .run_tests() .unwrap() .collect(); assert_eq!(run.len(), 3);
pub fn command(&self) -> Command
[src]
Run the build artifact.
pub fn exec(&self) -> CargoResult<CommandMessages>
[src]
Run the configured test, returning test events.
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,