pub fn execute(&self) -> Result<()> {
        let build = Build {
            quiet: self.quiet,
            packages: self.packages.clone(),
            workspace: self.workspace,
            exclude: self.exclude.clone(),
            all: self.all,
            jobs: self.jobs,
            lib: self.lib,
            bin: self.bin.clone(),
            bins: self.bins,
            example: self.example.clone(),
            examples: self.examples,
            test: self.test.clone(),
            tests: self.tests,
            bench: self.bench.clone(),
            benches: self.benches,
            all_targets: self.all_targets,
            release: self.release,
            profile: self.profile.clone(),
            features: self.features.clone(),
            all_features: self.all_features,
            no_default_features: self.no_default_features,
            target: self.target.clone(),
            target_dir: self.target_dir.clone(),
            manifest_path: self.manifest_path.clone(),
            ignore_rust_version: self.ignore_rust_version,
            message_format: self.message_format.clone(),
            unit_graph: self.unit_graph,
            future_incompat_report: self.future_incompat_report,
            verbose: self.verbose,
            color: self.color.clone(),
            frozen: self.frozen,
            locked: self.locked,
            offline: self.offline,
            config: self.config.clone(),
            unstable_flags: self.unstable_flags.clone(),
            xwin_cache_dir: self.xwin_cache_dir.clone(),
            xwin_arch: self.xwin_arch.clone(),
            xwin_variant: self.xwin_variant.clone(),
            xwin_version: self.xwin_version.clone(),
            ..Default::default()
        };
        let mut test = build.build_command("test")?;
        if self.doc {
            test.arg("--doc");
        }
        if self.no_run {
            test.arg("--no-run");
        }
        if self.no_fail_fast {
            test.arg("--no-fail-fast");
        }
        if let Some(test_name) = self.test_name.as_ref() {
            test.arg(test_name);
        }
        if !self.args.is_empty() {
            test.arg("--");
            test.args(&self.args);
        }

        if let Some(target) = self.target.as_ref() {
            if target.contains("msvc") {
                if env::var_os("WINEDEBUG").is_none() {
                    test.env("WINEDEBUG", "-all");
                }
                let env_target = target.to_uppercase().replace('-', "_");
                let runner_env = format!("CARGO_TARGET_{}_RUNNER", env_target);
                if env::var_os(&runner_env).is_none() {
                    test.env(runner_env, "wine");
                }
            }
        }

        let mut child = test.spawn().context("Failed to run cargo test")?;
        let status = child.wait().expect("Failed to wait on cargo test process");
        if !status.success() {
            process::exit(status.code().unwrap_or(1));
        }
        Ok(())
    }
/// Execute `cargo test` command
Execute `cargo test` command
Execute ` cargo test ` command
pub fn execute(&self) -> Result<()> {
        let build = Build {
            quiet: self.quiet,
            packages: self.packages.clone(),
            workspace: self.workspace,
            exclude: self.exclude.clone(),
            all: self.all,
            jobs: self.jobs,
            lib: self.lib,
            bin: self.bin.clone(),
            bins: self.bins,
            example: self.example.clone(),
            examples: self.examples,
            test: self.test.clone(),
            tests: self.tests,
            bench: self.bench.clone(),
            benches: self.benches,
            all_targets: self.all_targets,
            release: self.release,
            profile: self.profile.clone(),
            features: self.features.clone(),
            all_features: self.all_features,
            no_default_features: self.no_default_features,
            target: self.target.clone(),
            target_dir: self.target_dir.clone(),
            manifest_path: self.manifest_path.clone(),
            ignore_rust_version: self.ignore_rust_version,
            message_format: self.message_format.clone(),
            unit_graph: self.unit_graph,
            future_incompat_report: self.future_incompat_report,
            verbose: self.verbose,
            color: self.color.clone(),
            frozen: self.frozen,
            locked: self.locked,
            offline: self.offline,
            config: self.config.clone(),
            unstable_flags: self.unstable_flags.clone(),
            xwin_cache_dir: self.xwin_cache_dir.clone(),
            xwin_arch: self.xwin_arch.clone(),
            xwin_variant: self.xwin_variant.clone(),
            xwin_version: self.xwin_version.clone(),
            ..Default::default()
        };
        let mut test = build.build_command("test")?;
        if self.doc {
            test.arg("--doc");
        }
        if self.no_run {
            test.arg("--no-run");
        }
        if self.no_fail_fast {
            test.arg("--no-fail-fast");
        }
        if let Some(test_name) = self.test_name.as_ref() {
            test.arg(test_name);
        }
        if !self.args.is_empty() {
            test.arg("--");
            test.args(&self.args);
        }
        if let Some(target) = self.target.as_ref() {
            if target.contains("msvc") {
                if env::var_os("WINEDEBUG").is_none() {
                    test.env("WINEDEBUG", "-all");
                }
                let env_target = target.to_uppercase().replace('-', "_");
                let runner_env = format!("CARGO_TARGET_{}_RUNNER", env_target);
                if env::var_os(&runner_env).is_none() {
                    test.env(runner_env, "wine");
                }
            }
        }
        let mut child = test.spawn().context("Failed to run cargo test")?;
        let status = child.wait().expect("Failed to wait on cargo test process");
        if !status.success() {
            process::exit(status.code().unwrap_or(1));
        }
        Ok(())
    }
pub fn execute ( & self ) -> Result < ( ) > { let build = Build { quiet : self . quiet , packages : self . packages . clone ( ) , workspace : self . workspace , exclude : self . exclude . clone ( ) , all : self . all , jobs : self . jobs , lib : self . lib , bin : self . bin . clone ( ) , bins : self . bins , example : self . example . clone ( ) , examples : self . examples , test : self . test . clone ( ) , tests : self . tests , bench : self . bench . clone ( ) , benches : self . benches , all_targets : self . all_targets , release : self . release , profile : self . profile . clone ( ) , features : self . features . clone ( ) , all_features : self . all_features , no_default_features : self . no_default_features , target : self . target . clone ( ) , target_dir : self . target_dir . clone ( ) , manifest_path : self . manifest_path . clone ( ) , ignore_rust_version : self . ignore_rust_version , message_format : self . message_format . clone ( ) , unit_graph : self . unit_graph , future_incompat_report : self . future_incompat_report , verbose : self . verbose , color : self . color . clone ( ) , frozen : self . frozen , locked : self . locked , offline : self . offline , config : self . config . clone ( ) , unstable_flags : self . unstable_flags . clone ( ) , xwin_cache_dir : self . xwin_cache_dir . clone ( ) , xwin_arch : self . xwin_arch . clone ( ) , xwin_variant : self . xwin_variant . clone ( ) , xwin_version : self . xwin_version . clone ( ) , .. Default :: default ( ) } ; let mut test = build . build_command ( " " ) ? ; if self . doc { test . arg ( " " ) ; } if self . no_run { test . arg ( " " ) ; } if self . no_fail_fast { test . arg ( " " ) ; } if let Some ( test_name ) = self . test_name . as_ref ( ) { test . arg ( test_name ) ; } if ! self . args . is_empty ( ) { test . arg ( " " ) ; test . args ( & self . args ) ; } if let Some ( target ) = self . target . as_ref ( ) { if target . contains ( " " ) { if env :: var_os ( " " ) . is_none ( ) { test . env ( " " , " " ) ; } let env_target = target . to_uppercase ( ) . replace ( '-' , " " ) ; let runner_env = format ! ( " " env_target ) ; if env :: var_os ( & runner_env ) . is_none ( ) { test . env ( runner_env , " " ) ; } } } let mut child = test . spawn ( ) . context ( " " ) ? ; let status = child . wait ( ) . expect ( " " ) ; if ! status . success ( ) { process :: exit ( status . code ( ) . unwrap_or ( 1 ) ) ; } Ok ( ( ) ) }
Execute `cargo test` command
Execute ` cargo test ` command
&self
&self