Skip to main content

zoi_cli/cmd/package/
test.rs

1//! Running tests for packages.
2
3use anyhow::Result;
4
5use super::build;
6
7/// Runs tests for a package.
8///
9/// This command builds the package and runs its defined tests.
10/// If `install_deps` is set, it will also install necessary build dependencies.
11///
12/// # Errors
13///
14/// Returns an error if the tests fail or dependencies cannot be installed.
15pub fn run(args: &build::BuildCommand) -> Result<()> {
16    if args.install_deps {
17        build::install_dependencies_for_build(args, true)?;
18    }
19    crate::pkg::package::test::run(args)
20}