canic-testkit 0.27.11

Canic — a canister orchestration and management toolkit for the Internet Computer
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::path::{Path, PathBuf};

/// Resolve the workspace root from a crate manifest directory.
#[must_use]
pub fn workspace_root_for(crate_manifest_dir: &str) -> PathBuf {
    PathBuf::from(crate_manifest_dir)
        .parent()
        .and_then(|path| path.parent())
        .map(PathBuf::from)
        .expect("workspace root")
}

/// Return a stable target directory for host-side wasm test artifacts.
#[must_use]
pub fn test_target_dir(workspace_root: &Path, name: &str) -> PathBuf {
    workspace_root.join("target").join(name)
}