1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use anyhow::Result;
use xshell::Shell;

use crate::commands::cargo_cmd;
use crate::utils::{project_root, verbose_cd};
use crate::Config;

pub fn html_report(config: &Config) -> Result<()> {
    let sh = Shell::new()?;
    verbose_cd(&sh, project_root());

    let cmd_option = cargo_cmd(config, &sh);
    if let Some(cmd) = cmd_option {
        let args = vec![
            "llvm-cov",
            "nextest",
            "--ignore-filename-regex",
            "xtask",
            "--open",
        ];
        cmd.args(args).run()?;
    }

    Ok(())
}

pub fn report_summary(config: &Config) -> Result<()> {
    let sh = Shell::new()?;
    verbose_cd(&sh, project_root());

    let cmd_option = cargo_cmd(config, &sh);
    if let Some(cmd) = cmd_option {
        let args = vec!["llvm-cov", "nextest", "--ignore-filename-regex", "xtask"];
        cmd.args(args).run()?;
    }

    Ok(())
}