MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / setup

Function setup

tests/executors.rs:127–137  ·  view source on GitHub ↗

Installs the mode's tools before any of its runs, which would otherwise race each other (and the package manager lock) on a fresh machine.

(mode: &'static str)

Source from the content-addressed store, hash-verified

125/// Installs the mode's tools before any of its runs, which would otherwise race
126/// each other (and the package manager lock) on a fresh machine.
127fn setup(mode: &'static str) {
128 static DONE: Mutex<Vec<&str>> = Mutex::new(Vec::new());
129 let mut done = DONE.lock().unwrap_or_else(PoisonError::into_inner);
130 if !done.contains(&mode) {
131 codspeed()
132 .args(["setup", "--mode", mode])
133 .assert()
134 .success();
135 done.push(mode);
136 }
137}
138
139fn codspeed() -> Command {
140 let mut cmd = Command::new(env!("CARGO_BIN_EXE_codspeed"));

Callers 1

acquireMethod · 0.70

Calls 2

codspeedFunction · 0.85
argsMethod · 0.80

Tested by

no test coverage detected